Hey jiokl,
I would try using the serial port on the Arduino to take in information from the computer. The Arduino board could then process whatever input you send it. You can send such information through one of the computer's serial ports via a keypress.
Here's some tutorials that have helped me. The first uses python and pySerial to communicate with Arduino via serial communication over a serial port (like USB). The second is python code that uses python's GUI builder, "Tkinter," to take keyboard input from the keyboard in real time.
1. Serial Communication Tutorial:
http://postneo.com/2007/01/18/arduin...on-with-python
2. Dynamic Keyboard input Tutorial:
Code:
# respond to a key without the need to press enter
import Tkinter as tk
def keypress(event):
if event.keysym == 'Escape':
root.destroy()
x = event.char
if x == "w":
print "blaw blaw blaw"
elif x == "a":
print "blaha blaha blaha"
elif x == "s":
print "blash blash blash"
elif x == "d":
print "blad blad blad"
else:
print x
root = tk.Tk()
print "Press a key (Escape key to exit):"
root.bind_all('<Key>', keypress)
# don't show the tk window
root.withdraw()
root.mainloop()
source:
http://www.daniweb.com/software-deve...threads/115282
If you do not wish to use python, you can use pretty much any other language to do the same thing. Many languages, like C and Java, also are capable of serial communication.
I've been trying to do something similar with Arbotix and have had some helpful suggestions from others on this forum here:
http://forums.trossenrobotics.com/sh...2-via-Keyboard
Hope this helps,
-CyberPenguin
Bookmarks