Success! I changed my code to this and got a smooth sweep from 500 up...
Now to figure out what I was doing wrong to begin with. It's gotta be the LSB math?Code:byte msb = 0; byte lsb = 0; void setup() { Serial.begin(8192); } void loop() { delay(10); lsb++; if (lsb > 254) { msb++; lsb = 0; } byte b2[5] = {0x0A, 0x58, 0x00, msb, lsb}; unsigned int x = 0, sum = 0; for (x = 0; x < sizeof(b2); x++) sum += b2[x]; byte cs2 = ( 256 - ( sum % 256 ) ); Serial.write(b2, 5); Serial.write(cs2); }
Bookmarks