Go Down

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


Aug 03, 2011, 09:25 am Last Edit: Aug 03, 2011, 09:29 am by AWOL Reason: 1
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'.


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...
    if(counter == 2) counter = 0;


Now, what possible purpose is there for that delay?
The art of getting good answers lies in asking good questions.


@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