A quick demo video of IND.I/O's digital features..
The IND.I/O model of Industruino has very flexible digital I/O. The 8 channels can be software configured to be either inputs or outputs and support the full V-in range (6.5-32V). To demonstate this flexibility we created a fictional automatic recycling system which detects certain materials and drives a solenoid to seperate the waste stream. Please enjoy the video below!
Each one of the 8 output drivers can drive up to 2.6A. Loads can be anything ranging from lamps, heaters, indicators, motors and solenoids. To control all this functionality you can simply use the Arduino syntax which you are used to. For example, setting CH1 as ouput would be "Indio.digitalMode(1,OUTPUT);" and setting CH2 as input would be "Indio.digitalMode(2,INPUT);".
Below is the Arduino sketch which was used for the video:
/* Indio Library, for Industruino - wwww.industruino.com This library enables communication with the Industruino IND.I/O Baseboard. The IND.I/O Baseboard has 8CH of 24V digital I/O (6.5-32V supported), 4CH 0-10V/4-20mA ADC, 2CH 0-10V/4-20mA DAC, RS485 transceiver. WARNING!: PLEASE BE VERY CAREFUL WHEN CONNECTING PERIPHERALS TO YOUR IND.I/O AND CONFIGURING THE DIRECTION OF THE I/O. THE FAILURE MODE OF A 24V SHORTED CONNECTION IS MUCH MORE SPECTACULAR THAN WHEN WORKING AT 5V. */ #include <Indio.h> //include IND.I/O library #include <Class_define.h> // required for IND.I/O library #include <Wire.h> // required for IND.I/O library #include <UC1701.h> // include UC1701 LCD library static UC1701 lcd; int inductive = 0; //integer to hold PNP inductive proximity sensor state int capacitive = 0; //integer to hold PNP capacitive proximity sensor state int reflective = 0; //integer to hold PNP reflective IR proximity sensor state int var = 0; // integer to count down process length int ledState = LOW; // ledState used to set the LED long previousBlinkMillis = 0; // will store last time LED was updated long interval = 100; // interval at which to blink (milliseconds) void setup() { pinMode(13, OUTPUT); //set backlight pin to output analogWrite(13, 240); //set backlight intesity // INDI.I/O Baseboard has 8 channels of bidirectional 24V I/O (6.5-32V supported). // Here we choose the direction of each I/O channel. lcd.begin(); Indio.digitalMode(1,INPUT); // Set CH1 as an input Indio.digitalMode(2,INPUT); // Set CH2 as an input Indio.digitalMode(3,INPUT); // Set CH3 as an input Indio.digitalMode(6,OUTPUT); // Set CH6 as an output Indio.digitalMode(7,OUTPUT); // Set CH7 as an output Indio.digitalMode(8,OUTPUT); // Set CH8 as an output Indio.digitalWrite(8,LOW); // Set CH8 to low (0V) //print lcd header lcd.setCursor(0, 1); lcd.print("Reflective"); lcd.setCursor(0, 2); lcd.print("Capacitive"); lcd.setCursor(0, 3); lcd.print("Inductive"); } void loop() { //test each sensor for HIGH or LOW if (Indio.digitalRead(1) == 1){ reflective = 0; lcd.setCursor(64, 1); lcd.print("LOW "); } if (Indio.digitalRead(1) == 0){ reflective = 1; lcd.setCursor(64, 1); lcd.print("HIGH"); } if(Indio.digitalRead(2) == 1){ capacitive = 1; lcd.setCursor(64, 2); lcd.print("HIGH"); } if(Indio.digitalRead(2) == 0){ capacitive = 0; lcd.setCursor(64, 2); lcd.print("LOW "); } if(Indio.digitalRead(3) == 1){ inductive = 1; lcd.setCursor(64, 3); lcd.print("HIGH"); } if(Indio.digitalRead(3) == 0){ inductive = 0; lcd.setCursor(64, 3); lcd.print("LOW "); } //test for combinations of sensors triggered if (inductive == 1 && reflective == 1) { lcd.clear(); lcd.setCursor(20, 3); lcd.print("Metal detected"); lcd.setCursor(20, 5); lcd.print("Seperating..."); Indio.digitalWrite(8,HIGH); //flash indicator lamp and trigger solenoid for 3 seconds var = 0; while(var < 30){ unsigned long currentBlinkMillis = millis(); if(currentBlinkMillis - previousBlinkMillis > interval) { // save the last time you blinked the LED previousBlinkMillis = currentBlinkMillis; // if the LED is off turn it on and vice-versa: if (ledState == LOW) ledState = HIGH; else ledState = LOW; // set the LED with the ledState of the variable: Indio.digitalWrite(7,ledState); var++; } } //end flashing of LED and turn of solenoid Indio.digitalWrite(8,LOW); lcd.clear(); lcd.setCursor(0, 1); lcd.print("Reflective"); lcd.setCursor(0, 2); lcd.print("Capacitive"); lcd.setCursor(0, 3); lcd.print("Inductive"); } }