Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
program Timer_15min
'Microcontroller: Microchip PIC 16F84A
'Compiler: mikroBASIC PRO for PIC v3.20
'System Clock: 4MHz
'Clock Source: Crystal
'When button is pressed, LED is lit, then waits for 15 minutes, then LED is turned off
symbol TriggerPin = PORTA.B0
symbol LEDPin = PORTB.B0
const Fifteen = 900000 '900,000 miliseconds = 15 minutes
main:
TRISA = $FF 'All input
TRISB = 0 'All output
PORTB = 0
if (TriggerPin = 0) then 'If button pressed
LEDPin = 1
delay_ms(Fifteen) '15 minutes
LEDPin = 0
end if
while true
wend
end.
program Timer_15min
'Microcontroller: Microchip PIC 16F84A
'System Clock: 4MHz
'Clock Source: Crystal
'When button is pressed, LED is lit, then waits for 14 minutes, second LED is lit, then boths LEDs are turned off
symbol TriggerPin = PORTA.B0
symbol LEDPin = PORTB.B0
symbol LED2Pin = PORTB.B1
const FourteenMin = 840000 '840,000 miliseconds = 14 minutes
const OneMin = 60000 '60,000 miliseconds = 1 minute
main:
TRISA = $FF 'All input
TRISB = 0 'All output
PORTB = 0
if (TriggerPin = 0) then 'If button pressed
LEDPin = 1
delay_ms(FourteenMin) '14 minutes
LED2Pin = 1
delay_ms(OneMin) '1 minute
PORTB = 0 'Turn LEDs off
end if
while true
wend
end.