Files
SyncHome/trunk/workspace/gcb/16c84-knight.gcb
2023-03-09 12:51:54 +00:00

47 lines
1.1 KiB
Plaintext

' ########### start ###########
' pic:PIC16C84
' ########### end ###########
'
' ******************************************************************
' Knight Rider with a PIC16C84
' 2014-08-18 (c) Paolo Iocco#
' ******************************************************************
'
' Circuit diagram
' ---------------
' +--\/--+
' nc-----|1° 18|-----nc
' nc-----|2 17|-----nc
' nc-----|3 16|<--------H
' +5V--|50K|-->|4 15|<--------H = 4 MHz chrystal+ capacitors
' GND-------->|5 14|<--------+5V
' LED<--------|6 13|-------->LED
' LED<--------|7 12|-------->LED
' LED<--------|8 11|-------->LED
' LED<--------|9 10|-------->LED
' +------+
'
' ******************************************************************
#Chip 16C84, 4
#Config OSC = XT, WDT = OFF, PWRTE = ON, CP = OFF
dir PORTB out
dim direzione as byte
Startup:
direzione = 1
PORTB = 1
Loop:
do
if direzione=1 then
Rotate PORTB left
if PORTB >= 64 then direzione = 0
else
Rotate PORTB right
if PORTB <= 1 then direzione = 1
end if
Wait 250 ms
loop