This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
servo-interactive-test [2012/10/06 14:16] 85.218.109.130 |
servo-interactive-test [2012/10/11 12:30] (current) 46.57.95.208 |
||
---|---|---|---|
Line 2: | Line 2: | ||
<code java> | <code java> | ||
- | // Controlling a servo position using a potentiometer (variable resistor) | + | // Controlling a servo position using serial input |
- | // by Michal Rinott <http://people.interaction-ivrea.it/m.rinott> | + | |
#include <Servo.h> | #include <Servo.h> | ||
Line 38: | Line 37: | ||
} | } | ||
+ | </code> | ||
+ | |||
+ | then in python: | ||
+ | |||
+ | <code python> | ||
+ | import serial | ||
+ | ser=serial.Serial("/dev/ttyACM0", 9600) | ||
+ | ser.write("30\n") | ||
</code> | </code> |