loading
 With SRIO Library  you can extand your Arduino I/O with shift register 4021 and 74HC595
you can find this tutrorial here : http://www.e-licktronic.com/en/content/19-tutorial-library-sriohttp://www.e-licktronic.com/en/content/19-tutorial-library-srio
In this tutorial we will see how to use the library SRIO with Dilicktal Board

For this tutorial you need:
            -1x Midilickuino
            -1x Arduino
            -1x à 8x  Dilicktal
            -Arduino software (version 1.0 or newer)
            -SRIO Library
            -1x  USB cable   

SRIO Library description:

void Initialize();
//Initialize I / O used with Dilicktal

void Led_SR_Write (byte SR_num, byte data);
//Set a value of 8-bit shift register selected
// number of Dilicktal from 0 to 7 (0 => first Dilicktal connected , 1 => second Dilicktal connected...)
// Value sent from 0 to 255
// Example:
// Led_SR_Write(0,255) turns all LEDs ON of the first Dilicktal in the chain.

void Led_Pin_Write (byte Pin_num, byte flag);
//Set 0 or 1 in the Pin Led selected
// The number of pin ranges from 0 to 63 (0 being the first pin of the first Dilicktal ...)
// value sent  1 => ON or 0 => OFF
// Example:
// Led_Pin_Write (34,1) Turn ON the third LED of the fifth Dilicktal in the chain.

void Led_All_On();
// Turns all ON LEDs connected
// Do not need any parameters

void Led_All_Off();
// Turns all OFF LEDs connected
// Do not need any parameters

byte Led_SR_Read (byte SR_num);
// Returns the value (8 bits) of the state of the LEDs on the Dilicktal board selected
// Number of Dilicktal from 0-7 (0 => first Dilicktal connected, 1 => second Dilicktal connected ...)

byte Button_SR_Read (byte SR_num);
// Returns the value (8 bits) of the state of the buttons of the selected Dilicktal
// Number of Dilicktal from 0-7 (0 => first Dilicktal connected, 1 => second Dilicktal connected ...)

byte Button_Pin_Read (byte Pin_num);
// Returns the state of the button, 0 =>  released or 1 => pressed
// The number of pin ranges from 0 to 63 (0 being the first pin of the first Dilicktal ...)

Step 1: Install Library SRIO

How to use SRIO Library:

1-You copy the file "wiring_shift.c" located in Zip file library
SRIO and replace the old file in your Arduino environment.
It is located in: X:/ .../arduino-1.0.x/hardware/arduino/cores/arduino
This file has been modified to optimize the speed of communication between Arduino and Dilicktal.
Then open the file "Arduino.h" which is X:/.../ arduino-1.0.2/hardware/arduino/cores/arduino
Go to line 111 and replace lines 111 by "void shiftOut (uint8_t val);"
And line 112 by "uint8_t shiftIn ();"

Warning: The library SRIO only works with Arduino UNO, Pro, Duemilanove,
Diecimila, NG and Extreme.
For other Boards must change the code "wiring_shift.c."

If this is your case, contact us and we will send you the code to your Arduino Board

2-You must copy the folder "SRIO" located in Zip file library
SRIO and paste it into the folder "libraries" of your Arduino environment
It is located in: X:/ .../arduino-1.0.x/libraries
You are now ready to use the library SRIO.

3-We will now create a simple code that uses the library functions SRIO
Launch Arduino and import our library
Go to "Sketch" then "Import Library ..." you should see SRIO, click on it.
Then input the data constructors of the library: SRIO SR;
Followed by "void setup" and "void loop"
In "void setup" entry initialization function library: SR.Initialize ()
Your code should look like the following:


#include <SRIO.h>

SRIO SR;

void setup()
{
  SR.Initialize();
}

void loop()
{
}

About This Instructable

1,969 views

7 favorites

License:

More by e-licktronic: How to use SRIO library for Arduino
Add instructable to: