|
Autore |
Messaggio |
opzioni |
cavallo_leo
postato il: 06.06.2022, alle ore 08:49 |
AIUTO PER GREAT COW BASIC
CIAO A TUTTI
VOLEVO IL PROGRAMMA 12F675 MA NON MI FUNZIONA 2 PULSANTE.
UN PROGRAMMINO CHE PREMI 2 TASTI ACCENDO IL LED
PER QUESTO GREAT COW BASIC.
HO DUE PIC CON IL 16F88 + 16F84A NESSUNO PROBLEMA.
SOLO PROBLEMA 12F675!
GRAZIE
GREAT COW BASIC:
;Chip Settings
#chip 12f675
;Defines (Constants)
#define LED = GPIO.0 ' USCITA LED PIN NR. 7
Start:
if GPIO.1=1 then ' INGRESSO PULSANTE 1 PIN NR. 6
goto blink1
end if
if GPIO.2=1 then ' INGRESSO PULSANTE 2 PIN NR. 5
goto blink2
else
goto Start
end if
blink1:
for lampo = 0 to 7
Set LED On
Wait 1 s
Set LED Off
Wait 1 s
next
goto Start
blink2:
for lampo = 0 to 7
set LED on
Wait 3 s
set LED off
Wait 1 s
next
goto Start
|
|
rcc.roberto
[pagine pubblicate]
postato il: 06.06.2022, alle ore 09:06 |
Ciao, per cortesia, non scrivere tutto maiuscolo, e rileggi prima di premere invio. Non è che si capisce molto bene quello che hai scritto bisogna rileggere più volte per capire.
Ad una prima vista, penso che devi definire i PIN se sono ingressi, uscite, digitali, analogici. |
|
cavallo_leo
postato il: 06.06.2022, alle ore 09:11 |
;Chip Settings
#chip 12f675
;Defines (Constants)
#define LED = GPIO.0
Start:
if GPIO.1=1 then
goto blink1
end if
if GPIO.2=1 then
goto blink2
else
goto Start
end if
blink1:
for lampo = 0 to 7
Set LED On
Wait 1 s
Set LED Off
Wait 1 s
next
goto Start
blink2:
for lampo = 0 to 7
set LED on
Wait 3 s
set LED off
Wait 1 s
next
goto Start |
|
cavallo_leo
postato il: 06.06.2022, alle ore 09:14 |
Vedi PIC12f675 (numeri socket pin) (gp0,gp1,gp2...)
https://www.researchgate.net/figure/PIC12F675-Microcontrolle… |
|
rcc.roberto
[pagine pubblicate]
postato il: 06.06.2022, alle ore 10:16 |
Si, ho visto, ma intendo che devi definire ogni piedino se è un ingresso oppure una uscita e se è digitale oppure analogico, dovrebbe essere il registro TRISIO o qualcosa del genere |
|
cavallo_leo
postato il: 06.06.2022, alle ore 11:56 |
|
|
primok
postato il: 09.06.2022, alle ore 21:16 |
#chip 12f675
'Defines (Constants)
#define LED GPIO.0 ' USCITA LED PIN NR. 7
Dir LED out
#define P1 GPIO.1
Dir P1 in
wait 1 sec
#define P2 GPIO.2
Dir P2 in
wait 1 sec
Do
if P1=1 and P2=0 then ' INGRESSO PULSANTE 1 PIN NR. 6
Flash_LED(8,1000)
end if
if P2=1 and P1=0 then ' INGRESSO PULSANTE 2 PIN NR. 5
Flash_LED(8,3000,1000)
end if
Loop
Sub Flash_LED (in numtimes, in OnTime as WORD, optional OffTime as word = OnTime)
repeat numtimes
set LED on
wait OnTime ms
set LED OFF
wait OffTime ms
end repeat
End Sub
Più piccola è la mente più grande è la presunzione. |
|
cavallo_leo
postato il: 11.06.2022, alle ore 17:50 |
Funziona..
Grazie PrimoK
|
|
cavallo_leo
postato il: 15.06.2022, alle ore 09:28 |
Vedi di sotto: ????INGRESSO PULSANTE 3 PIN NR. 4
Non ci riesco.......
Grz
--------------------------------------------
#chip 12f675
'Defines (Constants)
#define LED GPIO.0 ' USCITA LED PIN NR. 7
Dir LED out
#define P1 GPIO.1
Dir P1 in
wait 1 sec
#define P2 GPIO.2
Dir P2 in
wait 1 sec
#define P3 GPIO.3
Dir P3 in
wait 1 sec
Do
if P1=1 and P2=0 then ' INGRESSO PULSANTE 1 PIN NR. 6
Flash_LED(8,1000)
end if
if P2=1 and P1=0 then ' INGRESSO PULSANTE 2 PIN NR. 5
Flash_LED(8,3000,1000)
end if
?????? INGRESSO PULSANTE 3 PIN NR. 4 (LED 10 secondi ON (NO LAMPEGGIA))
if P3=1 ................... then
...........................
end if
Loop
Sub Flash_LED (in numtimes, in OnTime as WORD, optional OffTime as word = OnTime)
repeat numtimes
set LED on
wait OnTime ms
set LED OFF
wait OffTime ms
end repeat
End Sub |
|
primok
postato il: 15.06.2022, alle ore 11:18 |
http://gcbasic.sourceforge.net/help/_pic_users_and_beginners…
Più piccola è la mente più grande è la presunzione. |
|
|