I am trying to control an LED using a computer interface.
ControllingChip
Posts: 2
I am trying to control an LED using a computer interface.
Can any one give me some ideas, because this is my first task to use microcontrollers.
the interface should have a button, once the user click on it the LED should turn on.
thanks
Post Edited By Moderator (Chris Savage (Parallax)) : 10/16/2007 3:49:26 PM GMT
Can any one give me some ideas, because this is my first task to use microcontrollers.
the interface should have a button, once the user click on it the LED should turn on.
thanks
Post Edited By Moderator (Chris Savage (Parallax)) : 10/16/2007 3:49:26 PM GMT
Comments
Are you trying to do this using a Stamp? If so, which one?
Although I am almost as new as you seem to be to the arena of microcontrollers, what you are attempting to do is easy with any of·the Stamps.
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
-Phil
Second, double-posting is highly discouraged! Try to post only to the forum that is most relevant to your needs. If there is ever any question as to where to post, post in the Sandbox, with a polite request for the mods to move the post if needed.
Okay, assuming that you just want to turn the LED "on", and are writing a computer program in Microsoft Visual Basic .Net, the process works something like this:
VB.Net program has a single button. When the button is clicked, program does the following:
- Opens a serial port connection
- Writes a "command" (can be a letter, number, sequence, etc.) to the
serial port that is open
- Closes the serial port connection
Meanwhile, on the BasicStamp/SX/Propeller, there is a program running that does this (essentially):
- Wait for a serial input on some pin
- Parse the input that's received
- Do something based on the received input
So, if your computer button sends a "1", your PBasic program would do this (in pseudocode):
SERIN... someCommand
if SomeCommand = 1
then TurnOnLED
So, from that general description, and following the basic concept, you can build all types of control systems. You have two program that each take turns sending & receiving, doing something based on what is communicated.
You can download for free C# 2005 Express , I have not yet worked on sending data to the PC from the microcontroller.
http://acousticlights.com/baudrate.html
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
yes I am using using the the BASIC Stamp to ON/OFF control of an LED.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
just Google controlling LED Printer port control.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A complex design is the sign of an inferior designer. - Jamie Hyneman, Myth Buster