program keeps restarting
brian6592
Posts: 18
Hello I am new to programming, and I am in the process of finishing a class project. My issue is my program keeps restarting for no apparent reason (The speaker emits a sound therefore i know it is restarting). I have ruled out the obvious culprit, batteries. I was wondering what are other things that could cause the software to restart? (certain commands, loops, etc.)
Thank you.
Thank you.
Comments
You stated that when you begin an IR avoidance routine (backing up?) things go awry.
My surmise was that you were experiencing a reset from a loss of power.
It's possible that when the battery is overtaxed that the voltage dips low enough to "force" a reset, and everything gets turned off (initialised) and everything is fine again till that tipping point is reached.
I don't know how long you have been working with this battery set.
Maybe you're re-initialising your program somehow?
and insert some strategic DEBUGs to find out where your program is cratering (if that's what's happening); be prepared to simulate conditions.
Sorry, I don't do PM-based help. If you can strip out portions of your program and still get what's left to fail, it won't do your compatriots any good to see what's posted.
I Hope this wasn't too lengthy and I didn't want to add another thread to the forum, so any input on my new situation is appreciated.
Thank You
With what you've described, the most you're getting to that fan is about 4V, thereaboutish.
The emitter should go to ground (Vss) and the fan should be between the collector and +12V.
Here's what:
If i add a seperate 9v battery, can i just pull the power for the fan from the 9V, and somehow use a pin as a switch to turn it on?
I really don't understand how the power management works on the Boe Bot.
This is the word doc I got the information from. I think i attached it to the post.
I added a pic to my previous post.
(Try using the Attachment Manager and uploading your pics as JPG etc.)
The arrow is the emitter.
On the 2N3904, looking at the flat/sqr side, with the legs pointing down, it's E-B-C.
The dwg at the top of your pic shows, I think, what I've advocated (it doesn't agree with the ckt presented in the lower 1/2 of your pic.)
Keep us posted as to your progress.
Localise that beeping.
Are you PWMing the fan or what?
' {$STAMP BS2}
' {$PBASIC 2.5}
duty VAR Word
counter VAR Word
time VAR Word
FREQOUT 4, 2000, 3000
duty = 132
Main:
duty = 132
FOR counter = 0 TO 4
duty = duty + 22
FOR time = 0 TO 500
PWM 15, duty, 1
NEXT
NEXT
GOTO Main
END
It'll probably go better using PAUSEs (LOOPing 1ms on, 9ms off for 10%; 5ms on, 5ms off for 50%; and so on.)
How does it go just turning it full on (OUTPUT 15, HIGH 15)?
[The program gets re-started by the GOTO Main, so there's no bug there.]
I attached a sketch of what to do in #17.
Well i did another sketch in paint to see if I had the wiring down.
The issue i am running into is where to connect the negative terminal of the 9V battery without using the 9V as the main power source for the board.
can i just plug a wire in the VSS hole going straight to the negative terminal of the 9V, or do i need to use a row on the breadboard?
Yes, that is what my sketch shows.
Connect the fan battery's negative to the Stamp/BoE/HWB Vss terminal/s.
You cannot run the fan from a pin directly, you need to have the transistor for that.
(Your sketch in #28 does not show the transistor.)
If you are running out of Vss places on the header then connect a wire from one of those to a row on the breadboard and then those are all Vss places, too.
Please advise as to your progress.