jeremyhill1989
New Member
Hi guys i am very new to c code language and i am just now writing my first code with the velleman p8048 programming kit and i am trying to program the 16f627. what i want to do is have a timer be started by the input (rao) but i want the timer to leave (portb) on for 20-30 seconds. is this even possible. if it is possible i want it to reset after 30 seconds. please can anyone help i am very new to programming and i need much help. i can get the (portb) light to turn on i just want it to turn on for 30 seconds thanks and here is my code
#include <conio.h>
#define SW1 0x00;
__CONFIG (0x3F61);
void main (void)
{
CMCON = 0x07;
TRISA = 0xFF;
TRISB = 0;
PORTB = 0x01;
while ( 1 )
{
if(RA0 == 1)
PORTB = 0b000001;
else
PORTB = 0b000000;
}
}
#include <conio.h>
#define SW1 0x00;
__CONFIG (0x3F61);
void main (void)
{
CMCON = 0x07;
TRISA = 0xFF;
TRISB = 0;
PORTB = 0x01;
while ( 1 )
{
if(RA0 == 1)
PORTB = 0b000001;
else
PORTB = 0b000000;
}
}