Someone Electro
New Member
here's the surce code of the PIC in mikroBasic
As for the conections there is an piezo speker on RB2 and the phototransistor output voltage to RA2.
The PIC is runing on its internal oscilator so no crystal
This one behaves like the one zatch made and as you see the code is very simple.
Il post the new code that has timing based on how fast do the lights get thurnded on.
btw:
what did you do whith your amp mether? (mine has an fused 200mA max input and an unfused 20A max input so its kinda hard to blow it)
Code:
program beeper
dim light as word
main:
CMCON = 7
ADCON1 = $00
TRISA = $FF
TRISB = $0
PORTB = $FF
Sound_Init(PORTB,2)
el:
light = ADC_read(2)
If light < 200 then
Sound_Play(10,10)
delay_ms(5000)
end if
goto el
end.
As for the conections there is an piezo speker on RB2 and the phototransistor output voltage to RA2.
The PIC is runing on its internal oscilator so no crystal
This one behaves like the one zatch made and as you see the code is very simple.
Il post the new code that has timing based on how fast do the lights get thurnded on.
btw:
what did you do whith your amp mether? (mine has an fused 200mA max input and an unfused 20A max input so its kinda hard to blow it)