Reference Links
Topics
Programming Prior Class Pages
PM Wiki |
Main /
CodeExamplesBasic Button Stuff - This code prints out a 1 when the user is currently pressing the button and a 0 when then are not pressing the button. This code is missing a delay and toggles the output when the user presses the button. As such it doesn't reliably print out a 1 or a 0. Good example for why timing is important. How to turn on and off 3 LEDs:
Three examples in one: Using the above code to write routines for a group of solenoid instruments Basic Touch Sensing with Arduino. The circuit one wire plugged into A0 and another plugged into +5V. When depending on whether you touch just the A0 wire, or almost touch the A0 wire, or touch both wires, you will get different degrees of certainty. In many cases, static electricity in the air will be enough to trigger a false positive. The below code starts in on data averaging, but doesn't go very far. Needs another example using Millis() as well. Write Your Own - Beginning Data Averaging... this code is very rudimentary, but it can be built up using Millis() to do timing http://jasonkrugman.com/classes/code/touch_sensor_examples.zip |