Pages: 1 [2]   Go Down
Author Topic: Processing and teensy arduino problem  (Read 2530 times)
0 Members and 1 Guest are viewing this topic.
Seattle, WA USA
Online Online
Brattain Member
Karma: 654
Posts: 50928
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

arduino IDE doesn't like "if(serial.available()>=4);
Why are you putting a semicolon at the end of an if statement? That forms the body of the if statement, and is, effectively a no-op. Do nothing if the statement is true. Do nothing if the statement is false.

By the way, surely you know that the Serial instance uses a capital S.

Temple, Texas
Offline Offline
Sr. Member
Karma: 14
Posts: 361
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


i have numbers in black window of processing when i run these 3 lines but only with this line in arduino IDE:

but my strip led light in wrong colour, only white with glitter

arduino IDE doesn't like "if(serial.available()>=4);

Your arduino is expecting 4 bytes at a time, the original code you posted was correct.  Proofread this part VERY carefully.  If "the IDE doesn't like it" and shows an error when you hit "Verify", then proofread it again VERY carefully smiley
//protocol expects data in format of 4 bytes
//(xff) as a marker to ensure proper synchronization always
//followed by red, green, blue bytes
if (Serial.available()>=4) {
   if( == 0xff){
      red =;
      blue =;

Pages: 1 [2]   Go Up
Jump to: