Ok, i’ve finally gotten to reading the Basic Atom manuel (after finding i have absolutley nothing else to do) and i have entered the simplest program they have given me, and it is to create a blinking LED heres the progam
Main
High P0
Pause 200
Low P0
Pause 200
End
i connect the LED and it turns on but it is only solidly lit, not blinking like the prgram says it will
any body have a clue to wat could b happening? ill be working on it
actually, after reading my manual, pause takes in the number of _milli_seconds you want the chip to wait, so you are basically doing .2 seconds. My guess is that your circuit is backwards where the LOW output will cause the LED to stay on.
and make sure your circuit is set up so that HIGH causes the LED to go on. This will blink the LED at a period of 4 seconds, with 2 second on and 2 second off times.
Let me know if you have any questions on how to set the circuit up properly.
You can also make an LED blink using the PWM function, without using a loop structure (it won’t last forever however as you set the number of cycles the PWM waveform will last). It’s a good next step as the PWM function can be used to do a whole lot more than blink LEDs, ie control a motor controller which then controls motor speed.
On my eyecon I’m using a similar function to PWM on the basic atom pro to drive the scorpion which in turn drives my motors.
This program outputs a waveform that has a 2 second period, 50% duty cycle (1 second on, 1 second off) and does 10 of those periods in a row. The PWM command takes in time in micro (10E-6) seconds, so 2,000,000 microseconds = 2 seconds, etc.
ok, i finally found it in the book, i must be reading a different manuel, mine is off the mirco website (or whatever it is) but i like it, cause it allows you to certain I/0 time for a set amount of time, like you said
ok, as this post suggests i’ve been learning simple programs and going through the programming manual, well i have a code to make it do a certain sequence of solids and flashing, and when i use the debugger, it works fine, but when i program the Basic Atom with it, it doesn’t work , it goes solid for 3 seconds, then turns off, then is solid for 1 second, then it turns off, and thats the end of the program
Solid:
High LED
Pause 3000
Low LED
Pause 3000
return
Slowflasher:
for timer=0 to 20
Toggle LED
pause 10
next
return
Solidfunny:
High LED
Pause 1000
Low LED
Pause 1000
return
ENDPROG:
end [/code]
please tell me if something is wrong with it, meanwhile i think i saw something about timing when using the debugger and actually programming your basic atom with it, ill let you guys know if i find it
The PAUSE command in the slowflasher is only set for 10 milliseconds, so basically it does 10 on-off pulses with a period of 20mS, which is like 0.02 seconds, so the whole on-off-on-off-on-off…etc waveform is 0.2 seconds long, hard to see…
Try playing with the value after PAUSE in the Slowflasher section (try a large number like 1000 mS, aka 1 second) and see what your results are.
I think it is just happening too fast (thus the routine name “slowflasher” is a bit…misconstrued =) )
yea, thats wat was wrong Mike, i also changed the code so it loops, i only had it going so fast because my brother challenged me to write a code that had a flasher that would flash 20 times in 2 seconds so that would mean i needed it to flash 10 times a second, but now that i think about it, idk if i did the math right