NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Sensors, Actuators, and Robotics » How to use the microcontroller to trigger an event on my pc
October 21, 2010 by giantclam |
I was wondering if there was any way to trigger an event, like playing a song, or opening a program on my PC, when I set a pin on the microcontroller from hi to low (or low to hi). I have been using the serial communication program minicom on linux. With that, I can easily send text that shows that the pin value has changed, but I haven't figured out how to send more than text. On my PC, using minicom, if I hit ctrl-a, I can get it into a mode where it will run a program. Can I send this ctrl-a character somehow from the microcontroller to the minicom? When I type in ^a it just prints ^a to the screen. I have spent several hours unsuccessfuly trying to find an answer. Any ideas would be greatly appreciated! |
---|---|
October 21, 2010 by mcai8sh4 |
Initial thought - you could write a simple python/perl/language of choice script that gets the signal from the mcu then exectes the command you wish (you'd have to have this program running all the time to 'listen' : "$ m./my_prog.py &") If you look through the forums (and the Nerdkits tutorials/examples) you'll find code from the led array project that can be adapted to do 'stuff' There are a many different ways to achive what you want, it's just a case of finding the method that suits you. Good luck, keep us all posted. And shout out if you get stuck, many people here happy to help :) -Steve |
October 21, 2010 by giantclam |
Thanks so much for pointing me in the right direction! I'll give it a whirl. |
Please log in to post a reply.
Did you know that you can aim and fire a servo-controlled water gun from your computer? Learn more...
|