PICAXE 08M -problem!!!

George-JF

New Member
PICAXE 08M -no problem :) *resolved

Demonstrative example of the problem:
works without problems:
start:
high 1
;pim 1 ON
pause 500
low 1
;pin 1 OFF
pause 5000 ;pin 1 OFF
goto start

Simulations on the PC =O.K. Picaxe 08M =K.O. -Error on line 5!!!!! :
start:
high 1
;pin 1 ON
pause 500
low 1
;pin 1 OFF
if b0=5 then let b0=5 endif ;pin 1 ON!!!! (different command IF THEN) Why?
pause 5000 ;pin 1 ON!!!
goto start

Yesterday I came shipment. Neither does not work properly!
 
Last edited:

alband

Senior Member
Welcome to the forum!

What version of programming editor are you using? (found in "help" - "about")

How do you know line 5 is the problem?

What is this code for?
 

Technical

Technical Support
Staff member
if b0=5 then let b0=5 endif ;pin 1 ON!!!! (different command IF THEN) !

If then...endif
is a multiline structure - please see the manual part2 for more details (look up the 'if' command)

so you must type

if b0 = 5 then
let b0 = 5
endif

for it to compile correctly.

You can force multiple lines on a a single line by using :
if b0 = 5 then : let b0 = 5 : endif
but it is not normally recommended.
 

George-JF

New Member
Hello.;)
What version of programming editor are you using? Version 5.2.6
How do you know line 5 is the problem? When you use the IF-THEN: pin 1=>ON (test-LED)


I read the manual. Each command IF-THEN (any form) enables PIN, which was switched off.
Also, non-functional (simulation O.K.):

symbol xx=20
symbol yy=50
b1=2
start:
for b0=1 to 3
high b1
pause xx
low b1
pause xx
next b0
pause yy
if b1=2 then let b1=1 goto start endif
if b1=1 then let b1=4 goto start endif
if b1=4 then let b1=2 goto start endif
 

George-JF

New Member
simple example:

b1=2
start:
low 4
pause 500
if b1=2 then goto start

PIN 4 -LED still shines! (simulation=still OFF) -it is not logical.
 
Last edited:

George-JF

New Member
Need to see your circuit diagram.
How is the LED connected?
Are you using a project board? If yes, which one?
I'm so sorry!
I was distracted fool.

I used SERVO DRIVER (AXE024). But I engage pins wrong. I was distracted. :mad: LED=Picaxe PIN and +5V.
Once again so sorry!!! And thank you!
 

WHITEKNUCKLES

New Member
'Dare I say that it seems to work on 08M?
start:
high 1 ;pin 1 ON
pause 500
low 1 ;pin 1 OFF
if b0 = 0 then let b2 = b2 + 1 endif
if b2 > 10 then gosub dd
debug
pause 1000
goto start
dd:
high 2
return
 
Top