- #1
Maniac_XOX
- 86
- 5
- TL;DR Summary
- I have connected the Buzzer to the RC0 pin of PORTC but it is not working, I need it to sound with a period of 5 seconds on and 5 off. I can definitely handle the periods with timers or delay functions but I need the circuit to be working first.
crystal frequency is 4MHz
The code i have tried is:
Code:
#include <p18cxxx.h>
#include <xc.h>
void main(void)
{
TRISC = 0; // making TRISC pins output
ADCON1 = 0x07; // making them digital pins
while(1)
{
RC0 = 1;
__delay_ms(5000);
RC0 = 0;
}
}