Hi,
hello everyone, I am new to this forum.
Can you help me find out where the problem is on my stupid little program with a picaxe 14m? (to control two motors with relays)
This is the list:
; Troncatrice
; Programma per PICAXE-14
symbol motore_troncatrice = 2 ;output 2 >>> pin 11
symbol attuatore_scende = 5 ;output 5 >>> pin 8
symbol attuatore_sale = 4 ;output 4 >>> pin 9
symbol tt = b0
symbol zz = b1
symbol avvio = pin4 ;input 4 >>> pin 3
symbol finecorsa_sale = pin3 ;input 3 >>> pin 4
symbol finecorsa_scende = pin2 ;input 2 >>> pin 5
main:
if finecorsa_sale = 0 then
goto resetta
endif
low motore_troncatrice
low attuatore_scende
low attuatore_sale
tt = 0
zz = 0
if avvio = 1 then
pause 100
goto scende
endif
goto main
scende:
high motore_troncatrice
if tt = 0 then
goto ritardo
endif
high attuatore_scende
if finecorsa_scende = 1 then
low attuatore_scende
goto attesa
endif
goto scende
ritardo:
pause 3000
tt = 1
goto scende
ritardo1:
pause 3000
zz = 1
low motore_troncatrice
goto sale
attesa:
pause 5000 ;pausa di 5 secondi
goto sale
sale:
high attuatore_sale
if zz = 0 then ritardo1
if finecorsa_sale = 1 then
low attuatore_sale
goto main
endif
goto sale
resetta:
high attuatore_sale
if finecorsa_sale = 1 then
goto main
endif
goto resetta
In the simulation software is all very well, the programming of the chip is ok, but when I put the chip on the card hardware go haywire
Picaxe outputs on the card, are isolated by optocouplers to control the relay
Thank to all
(excuse my bad english)
hello everyone, I am new to this forum.
Can you help me find out where the problem is on my stupid little program with a picaxe 14m? (to control two motors with relays)
This is the list:
; Troncatrice
; Programma per PICAXE-14
symbol motore_troncatrice = 2 ;output 2 >>> pin 11
symbol attuatore_scende = 5 ;output 5 >>> pin 8
symbol attuatore_sale = 4 ;output 4 >>> pin 9
symbol tt = b0
symbol zz = b1
symbol avvio = pin4 ;input 4 >>> pin 3
symbol finecorsa_sale = pin3 ;input 3 >>> pin 4
symbol finecorsa_scende = pin2 ;input 2 >>> pin 5
main:
if finecorsa_sale = 0 then
goto resetta
endif
low motore_troncatrice
low attuatore_scende
low attuatore_sale
tt = 0
zz = 0
if avvio = 1 then
pause 100
goto scende
endif
goto main
scende:
high motore_troncatrice
if tt = 0 then
goto ritardo
endif
high attuatore_scende
if finecorsa_scende = 1 then
low attuatore_scende
goto attesa
endif
goto scende
ritardo:
pause 3000
tt = 1
goto scende
ritardo1:
pause 3000
zz = 1
low motore_troncatrice
goto sale
attesa:
pause 5000 ;pausa di 5 secondi
goto sale
sale:
high attuatore_sale
if zz = 0 then ritardo1
if finecorsa_sale = 1 then
low attuatore_sale
goto main
endif
goto sale
resetta:
high attuatore_sale
if finecorsa_sale = 1 then
goto main
endif
goto resetta
In the simulation software is all very well, the programming of the chip is ok, but when I put the chip on the card hardware go haywire
Picaxe outputs on the card, are isolated by optocouplers to control the relay
Thank to all
(excuse my bad english)