A little bit of help?
muppet
Posts: 4
Hi, I'm new to this board and this will be my very first post. Anyways, I've never really worked on a microcontroller before and, if it's possible, I could use some help. I'm sure this may seem like a stupid question, but I'd love all the help I can get. I've got a basic stamp, a motor, and a photoresistor. What I'd like to do is program it to when light to the photoresistor is blocked the motor will begin to spin counterclockwise. When that it is no longer blocked the motor will stop spinning and, well, that's that. I'm just not familiar with programming and the microcontoller manual is helpful, but I just don't get it.
Any feedback would be much appreciated. Sorry to post what must seem like a very newb-ish question.
Any feedback would be much appreciated. Sorry to post what must seem like a very newb-ish question.
Comments
Sounds like a fun project. Have you downloaded and looked at the WAM? text? A lot is covered in there. What kind of motor are you talking about? Makes a big difference.
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Martin Hebel
StampPlot - Graphical Data Acquisition and Control
AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
Read the photoresistor using RC time
if the value is too large,
run a loop to move the servo to needed position
else
run a loop to turn servo the other position
loop back
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Martin Hebel
StampPlot - Graphical Data Acquisition and Control
AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
...and it seems like my 9 volt battery has gone out. Either that or I've somehow managed to break it. Anyways, I haven't tried any really hard programming yet. Just messing around with what I think makes sense for an If, Then statement. For instance:
...
counter var word
time var word
do
high 2
pause 100
RCTIME 2, 1, time
DEBUG HOME, "time = ". DEC5 time
IF TIME=2 THEN
DEBUG "Counterclockwise 10 o'clock", CR
FOR counter = 1 to 150
PULSOUT 14, 1000
NEXT
ENDIF
LOOP
END
I could be totally wrong with that coding, but since my battery (hopefully) died I have to test it tomorrow sometime. I haven't even gotten around to starting the actual art that goes along with this piece. This may turn out to be such a hassle. If you guys have some more input it would so, so, so very much be appreciated.
for counter = 1 to 150
PULSOUT 14,750
pause 20
next
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Wow. Thanks for that. Did the other part of the code seem alright?