Files
SyncHome/trunk/workspace/gcb/12f675-Sirena.gcb
2023-03-09 12:51:54 +00:00

52 lines
1.1 KiB
Plaintext

' ########### start ###########
' pic:PIC12F675
' ########### end ###########
'
' ******************************************************************
' Sirena per Matteo
' 2015-09-06 (c) Paolo Iocco
' ******************************************************************
'
' Circuit diagram
' ---------------
' +--\/--+
' +5V ------>|1° 8|<-------GND
' SndOut <----|2 7|----> LED1
' A3/D1 -----|3 6|----> LED2
' MCLR ---->|4 5|----- D3/A2
' +------+
'
' ******************************************************************
#include "pic8_pin.h"
'Chip model
#chip 12F675, 4
#config WDT = OFF, CP = OFF, MCLRE=ON ' PWRTE = ON
#define led1 D4
#define led2 D5
#define SoundOut D0
#define ritardo 120
dir led1 out
dir led2 out
Startup:
'Main routine
Loop:
Repeat 5
'Turn one LED on, the other off
SET led1 ON
SET led2 OFF
Tone 523, ritardo '(length= ritardo * 10ms)
'Now toggle the LEDs
SET led1 OFF
SET led2 ON
Tone 784, ritardo '(length= ritardo * 10ms)
End Repeat
SET led1 OFF
SET led2 OFF
asm sleep
goto Loop