Go Down

Topic: Wireless Servo Control (Read 2 times) previous topic - next topic

AWOL

#15
Aug 03, 2011, 09:25 am Last Edit: Aug 03, 2011, 09:29 am by AWOL Reason: 1
Quote
I understood the numbers way better than a through c

They are all just numbers.
The ASCII character 'a' has the hex val 0x61 (97 decimal), and 'c the value 0x63.
So, if you receive a lower-case alphabetic character and want to convert it to an index 0..2, just subtract 'a'.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

PaulS

If you put each { and } on its own line, and use Tools + Auto Format, you will see that you have this structure:
Code: [Select]
void loop()
{
  if (mySerial.available() > 0)
  {
    int inByte = mySerial.read();

    if(counter == 0) serByte = (byte)inByte;
// Snipped...
    counter++;
    if(counter == 2) counter = 0;

    delay(15);
  }
}

Now, what possible purpose is there for that delay?

Woehrlec

@PaulS Your right, not sure why that delay is there..........

@AWOL Oh, I should of known that.....thanks for the reminder.

I'll try to polish up my code later today.

Thanks =]

Go Up