Thursday, May 19, 2016

Demo for the Python Interface Class for Onion to Arduino Integration

The code for this demo (Demo.py) is on GitHub with the interface itself.  Below is an illustration of the demo breadboard with pictures of the individual components:


But where, you ask, is the Onion Arduino dock?  For some reason mine has stopped accepting a flash so I substituted a China Clone Nano instead.  The Onion library still works as if it were on the Uno and I was able to complete the demo!

The point of the demo is to provide an example of each interface function in operation.   In thinking about how to do this I came up with the above:
  • Range finder to illustrate pwmPulseHigh
  • Buzzer that sounds when a distance threshold has been breached to illustrate pwmWrite (though I am not taking advantage of different volumes that are possible with PWM)
  • Potentiometer, or variable resistor, as part of a voltage divider illustrating the reading of voltage using an analog pin.  The voltage reading is used to adjust the sensitivity of threshold where the alarm sounds
  • Servo to illustrate the servo control capability of the interface.  It moves to show the position of the above variable resistor.
  • Push button to illustrate the internal pull-up capability of the Arduino as well as a digitalRead.  Pushing the button ends our demo script.
And finally, a video clip of the demo in operation!


No comments:

Post a Comment