Você está na página 1de 1

Arduino

https://www.youtube.com/watch?v=RMcL-Cn1qVM
Cdigo fonte Arduino: http://pastebin.com/NyW69Yh5
Cdigo fonte Java: https://github.com/diegoifnmg/arduino
Biblioteca TXRX: http://search.4shared.com/postDownload/kABD1ofNce/rxtx-21-7-bin
s-r2.html

http://www.delineneo.com/2012/03/06/monitor-your-jenkins-build-with-an-arduino-a
nd-some-java-code/
https://github.com/deline/JenkinsStatus

Cdigo - arduino
const int LEDVERMELHO = 12;
const int LEDAMARELO = 11;
const int LEDVERDE = 10;
int byteEntrada = 0;
void setup(){
Serial.begin(9600); // Abre a porta serial
pinMode(LEDVERMELHO,OUTPUT);
pinMode(LEDAMARELO,OUTPUT);
pinMode(LEDVERDE,OUTPUT);
digitalWrite(LEDVERMELHO,LOW);
digitalWrite(LEDAMARELO,LOW);
digitalWrite(LEDVERDE,LOW);
}
void loop(){
if(Serial.available()>0){
byteEntrada = Serial.read();
if(byteEntrada == '0'){
digitalWrite(LEDVERDE,LOW);
}else if(byteEntrada == '1'){
digitalWrite(LEDVERDE,HIGH);
}
if(byteEntrada == '2'){
digitalWrite(LEDAMARELO,LOW);
}else if(byteEntrada == '3'){
digitalWrite(LEDAMARELO,HIGH);
}
if(byteEntrada == '4'){
digitalWrite(LEDVERMELHO,LOW);
}else if(byteEntrada == '5'){
digitalWrite(LEDVERMELHO,HIGH);
}
}
}