User Tools

Site Tools


oak:tutorials:rollingball

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
oak:tutorials:rollingball [2016/04/11 05:53]
nog3 [Code:] Added Particle.publish() example.
oak:tutorials:rollingball [2016/04/11 05:58]
nog3
Line 10: Line 10:
 |  Breadboard| 1| | |  Breadboard| 1| |
 |  SW-520D Rolling Ball Switch | 1| | |  SW-520D Rolling Ball Switch | 1| |
-|  ​1k Resistor | 1 | Brown, Black, ​Red |+|  ​10k Resistor | 1 | Brown, Black, ​Orange, Gold|
 |  M to M 30cm Jumper Wire| 3| Red, Black, Blue| |  M to M 30cm Jumper Wire| 3| Red, Black, Blue|
  
Line 19: Line 19:
 {{:​oak:​tutorials:​tiltyswitchexample.jpg?​direct&​200|A tilt switch}} {{:​oak:​tutorials:​tiltyswitchexample.jpg?​direct&​200|A tilt switch}}
  
-**Pull-Down Resistor:** In this lesson we will use a Pull-Down resistor to make sure we can reliably detect ​button presses. If an I/O pin is 'left floating'​ reading it's value can result in either HIGH or LOW. By attaching a resistor between the I/O pin of the Oak and GND we can ensure that if the button ​is not pressed, the state is always LOW.+**Pull-Down Resistor:** In this lesson we will use a Pull-Down resistor to make sure we can reliably detect ​the tilt switch tilting. If an I/O pin is 'left floating'​ reading it's value can result in either HIGH or LOW. By attaching a resistor between the I/O pin of the Oak and GND we can ensure that if the tilt switch ​is tilted, the state is always LOW.
  
 =====Circuit:​===== =====Circuit:​=====
Line 120: Line 120:
 =====Conclusion:​===== =====Conclusion:​=====
  
 +Tilt switches are a very simple analog way of checking if something has tilted. They can be used to detect basic movement but are very sensitive and don't like vibrations. Always make sure to debounce them with pullup resistors and if you find them too sensitive, debouncing code. [[https://​www.arduino.cc/​en/​Tutorial/​Debounce|The arduino debouncing tutorial]] is a good primer on this.
oak/tutorials/rollingball.txt · Last modified: 2016/04/11 05:58 by nog3