//Code to test the hello.bus.45.bridge board with serial communication and a led. #include SoftwareSerial mySerial(3, 4); #define MYADDRESS 1 int incomingByte = 0; // for incoming serial data int led_pin = 0; //Pin5 of the ATtiny45 int led_data = 0; int addressBoard = 0; void setup() { mySerial.begin(9600); pinMode(led_pin, OUTPUT); } void loop() { //if (mySerial.available() > 0) { if (mySerial.available() >= 2) { int addressByte = mySerial.read(); if (addressByte == MYADDRESS) { led_data = mySerial.read(); analogWrite(led_pin, led_data); } else { mySerial.read(); mySerial.read(); } //incomingByte = mySerial.read(); //analogWrite(led_pin, incomingByte); //mySerial.print("I received: "); //mySerial.println(incomingByte); } //delay(1); }