Pages: [1]   Go Down
Author Topic: LED dimmer w/ Processing  (Read 614 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

-
« Last Edit: December 14, 2012, 01:00:43 pm by Tesla_pow » Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 149
Posts: 5630
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Serial communication sends ASCII-strings

No, serial sends whatever you tell it to.

Seems like I have to attach some kind of identification to my serial redValue and greenValue in the processing sketch but I'm not sure how to do this. Serial communication sends ASCII-strings, but how to incorporate this into different values like red and green?

arduino.write('r');     // Identifier for 'red'
arduino.write(redValue);

Then look for incoming 'r' at the other end.
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

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

-
« Last Edit: December 14, 2012, 01:01:18 pm by Tesla_pow » Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 149
Posts: 5630
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What are those 'delay(10)' for? Maybe that's too long.

Surely there's a way to wait until serial data is available instead of doing a randomly chosen delay and crossing your fingers.




Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Pages: [1]   Go Up
Jump to: