Blogroll
-
Recent Posts
Archives
- March 2023
- February 2023
- November 2022
- September 2022
- August 2022
- April 2021
- July 2018
- June 2018
- May 2018
- December 2017
- September 2017
- August 2017
- February 2017
- June 2016
- May 2015
- April 2015
- March 2015
- December 2014
- October 2014
- September 2014
- June 2014
- May 2014
- April 2014
- March 2014
- February 2014
- January 2014
- December 2013
- November 2013
- October 2013
- September 2013
- August 2013
- July 2013
- June 2013
- May 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- November 2012
- October 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
Meta
Monthly Archives: June 2016
Ultrasonic Toggle Switch Source Code (Arduino)
// ultrasonic toggle switch // Joe Schembrie aka ‘Engineer Zero’ // comments 6-23-2016 // the circuit for this sketch consists of a yellow and green LED and an ultrasonic distance sensor (pinger). // when a hand approaches the pinger, the yellow light comes on with the approach. // when the hand gets close enough, the value of green is toggled. // IE, if the green LED was off, it turns on. If it was on, it turns off. // to see this in action, visit https://engineerzero.wordpress.com/2014/06/01/ultrasonic-toggle-switch/ // The green LED toggles only once while the hand is near. // IMPORTANT // The hand must be retracted far enough so that the yellow light goes off // for the green LED to be toggled again. This prevents ‘bouncing.’ // NOTE: In some respects, this device seems to work best when the yellow light is disconnected. // NOTE ON NOTE: I wrote the above note a couple years ago AND DON’T REMEMBER WHY. // Now for inclusion of the library. // the NewPing.h library is available on the Internet. // I did not write it. I cannot answer questions about it. // It comes with documentation on the Internet. // Google away! #include <NewPing.h> #define TRIGGER_PIN 11 // Arduino pin tied to trigger pin on the ultrasonic sensor. #define ECHO_PIN 10 // Arduino pin tied to echo pin on the … Continue reading
Posted in Uncategorized
1 Comment