I'm very new to both the ez-b4 and Arduino and need basic help or advice. With my robot I want to be able to control LEDs through an Arduino. I have a Mega and with it I can add more LED functions to it as I learn. I've been reading a lot of posts on this and I took in so much info, I think I'm just dangerous and not knowledgeable.
I want to start simple, just turn on and off LEDs through my Arduino. I eventually want to control more LEDs and do more than just turn on and off.
Right now my Ez-b is powered through my main power source at 7v. My Arduino is plugged into my laptop and powered with USB, once mounted in my robot, an R2, it will run off the same power source, not through the Ez-b, and will power up when the Ez-b powers up.
Using UART 0 I connect the TX and RX to TX and RX of the Arduino. I'm unsure if it matters which ones. TX0, RX0 or any of the other numbered through 1-3, pins 14-19.
I found a nice Arduino code to get me going for loading onto the Arduino.
2 Simple LED sketch
5 int led = 13; // Pin 13
7 void setup()
9 pinMode(led, OUTPUT); // Set pin 13 as digital out
11 // Start up serial connection
12 Serial.begin(9600); // baud rate
16 void loop()
18 String input = "";
20 // Read any serial input
21 while (Serial.available() > 0)
23 input += (char) Serial.read(); // Read in one char at a time
24 delay(5); // Delay for 5 ms so the next char has time to be received
27 if (input == "on")
29 digitalWrite(led, HIGH); // on
31 else if (input == "off")
33 digitalWrite(led, LOW); // off
I still have a bunch to read up on the scripting part in ARC and how to actually send the on off command, but first, how do I correctly connect the two devices together? I know I can connect LEDs to the Ez-b, but it will use up ports and I want to expand my use of LEDS.
Thanks and sorry forwhat I'm guessing is probably very basic question.