Skip to content

Instantly share code, notes, and snippets.

@calroc
calroc / Tkjoy.py
Created December 26, 2012 00:27
A simple script using pyFirmata to talk to an Arduino Uno with a joystick plugged into it. See http://thinkpigeon.blogspot.com/2012/12/joystick-and-arduino-uno.html for details and images.
from Tkinter import *
from pyfirmata import Arduino, util
SERIAL_PORT = '/dev/ttyACM0'
DIM = 300
def read_pins(xpin, ypin):
x = xpin.read()
if x is None:
x = 0.0