traffic light status change

Joined
Jan 17, 2015
Messages
3
Reaction score
0
Has anyone made the traffic light status change using the Arduino UNO. I have tried a few sketches that I have found here but with no help.
I have been trying to make this one work, and I can see the changes using the serial monitor ( I do shut down the serial monitor after testing.. ) But Blue IRIS under Digital I/O tab to COM8, and check the box for "Set red traffic signal Icon input to " 1.. Does not see anything.
I am running the latest version of Blue IRIS ( 4.0.0.21x64 )
Steve

/*
Trigger Input to Blue Iris

Turns ON then OFF LED connected to digital pin 13
and triggers DIO 1, once pushbutton attached to
pin 2 is depressed.
DIO=VAL: 0=1 1=2 2=4 3=8 4=16 5=32 6=64 7=128

The circuit:
* Existing LED attached from pin 13 to ground
* Pushbutton attached to pin 2 from +5V
* 10K resistor attached to pin 2 from ground

*/
const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
int buttonState = 0; // variable for reading the pushbutton status
void setup()
{
pinMode(ledPin, OUTPUT); // initialize the LED pin as an output
pinMode(buttonPin, INPUT); // initialize the pushbutton pin as an input
Serial.begin(9600); // open serial port
}
void loop()
{
buttonState = digitalRead(buttonPin); // read the state of the pushbutton value
if (buttonState == HIGH) // if the pushbutton is depressed then:
{
digitalWrite(ledPin, HIGH); // turn LED ON
// Serial.print(2,BYTE); //send trigger DIO 1
Serial.println(2);
delay(100); //delay .1 second

}
else //if pushbutton is not depressed do the following
{
digitalWrite(ledPin, LOW); // turn LED OFF
// Serial.print(0,BYTE); //turn off all DIO trigger
Serial.println(0);
delay(100); //delay .1 second
}
}
 
Top