View Full Version : Basic stamp 2 serial interface
02-22-2010, 08:48 AM
Ok i am sorry if the answer to my question has aready been given but i cant find it. i am in the process of making a custom light show using the basic stamp 2. i need to use the simple high/low commands and also the servo commands. but my problem is that the code for the show will be way to long to fit on the eeprom. and my question is. is there any way to have the code on my computer and have it send the commands one at a time or parts. but it has to do it by it self.
02-22-2010, 09:29 AM
It certainly is possible to have a program on your PC that sends information to the Stamp, but you might be able to get it all on the Stamp. You can set up tables using the DATA statement that contains the information needed for the show in a very compact form. Your program could then read it with the READ statement and perform the show. Other possibilities include changing to another Stamp model with more program memory that could be used for program or more tables. Another option includes using an external EEPROM to store the show data or Parallax's Memory Stick Datalogger which could store the show as a file on a USB Memory Stick that you could load on the Memory Stick from your PC.
02-22-2010, 10:35 AM
i am basicly making a party light system i can fit one song worth of commands on the stamp. i do not have the money to buy a new stamp. i have not spent anything on the system yet. it is made out of parts i have found or were given. the stamp is actually from a sumo bot i got from my school. i could put a program on run it then put one for the next song. but i wanted to be able to hit play and go threw 5-10 song without haveing to do anything. and since i will always have a computer with it to play the music i thought that it would be the best way to do it. also i am new to the Stamp and what it can do. Any help is appriciated
02-22-2010, 10:51 AM
First you have to learn how to program the Stamp. Start with the "What's a Microcontroller?" tutorial and the "BASIC Stamp Syntax and Reference Manual". "What's a Microcontroller?" has a chapter (8) on playing songs. You may also find some of the Nuts and Volts Columns useful, particularly #6 which deals with the use of switching transistors to control relays, small motors, and high power LEDs.
I had mentioned using DATA statements to hold the song information. A lot depends on what you want to control and how you want to control it. Describe in more detail what you want to do.
You normally use the SERIN statement to input serial data, like from a PC. Also look at the DEBUGIN statement which is similar.
02-22-2010, 11:32 AM
i know the basic programing to control the lights. they use high/low and also i have made a moving head light witch uses the same control as ordanary servos. the lights i am using are par 34's witch are controlled using NPN Transitors and relays. i mainly just want to be able to have the code on the computer and the stamp running it. thanks for the help.
02-28-2010, 11:27 AM
Do you know anything about Basic, C, C# or C++ programming? I just joined the forum today and in browsing through old posts I see that there are ways to connect the Stamp via USB or serial port to the computer and enable it to run from there, if that makes sens.