very simple serial question

I am trying to send a value to my arduino 1-127 through a serial connection from my computer, and have it save in a variable, does anyone out there already have this code written? The issue I'm having is that it only prints out one number at a time, I'm pretty sure I could figure this out but thought I would ask and see if anyone has already done this.


Does this help...

  • Brian

I figured it out. Here is the code

byte incomingByte[3];      
int count=0;

void setup() {
void loop() {
  if (Serial.available() > 0) {
      int total = 0;
      for (int i = 0; i < count; i++){
        total = total*10 + (incomingByte[i] - '0');