Pages: 1 [2]   Go Down
Author Topic: Wireless Servo Control  (Read 2765 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 310
Posts: 26632
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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'.
« Last Edit: August 03, 2011, 02:29:59 am by AWOL » Logged

"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.

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 654
Posts: 50928
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you put each { and } on its own line, and use Tools + Auto Format, you will see that you have this structure:
Code:
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?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@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 =]
Logged

Pages: 1 [2]   Go Up
Jump to: