Changes

Jump to: navigation, search

Week 4 Lab

10 bytes removed, 15:47, 21 April 2009
Send Data from the Computer to Control your your Arduino
* EXPLANATION: What did we just do? The problem in our original Dimmer code was that the microcontroller was looking just at the binary value of the data it was receiving, but did not know what key was pressed. So, when we typed the number 0, which happens to have a binary value of ___ in the ASCII table, it will set the speed to that value, not to 0. We changed the program so the microcontroller is looking for the specific characters, '0' to '9', and then doing the appropriate math to set the output to the right speed.
== Send Data = controlling your arduino from the Computer to Control your your Arduino processing app ===
Save your modified Dimmer example, and revert back to the original dimmer code. We are now going to learn how to control the processor from the processing App. See the commented Processing code hidden at the end of the Dimmer program.
* In Processing, open a new sketch, and copy this code into it. Save this sketch as "arduino_test" or something like that. It should look like this:

Navigation menu