I'm using PIC16F18326.
I need to read some ADC (AN0) inputs and according to the input value I have a green (PIN_A1) or red (PIN_A5) signal output.
I think I have some problem with Osc or clock frequency because my delays are wrong.
Other thing is: I only need to make one test (one program main), but it was always running as I have a while(true).
May I have some help from you?
Code:
#include <16F18326.h>
#device ADC=10
#FUSES LVP // Should be NOLVP
#FUSES WDT //Watch Dog Timer
#FUSES RSTOSC_LFINTRC
#FUSES NOCLKOUT
#FUSES BROWNOUT, LPBOR, PUT, BORV27 // Power up Timer and Brownouts
#FUSES NOPROTECT // Should be NOPROTECT
#fuses NOEXTOSC // *** ADD THIS LINE RIGHT HERE ***
#use delay(internal=32000000) //,restart_wdt)
output_low(PIN_C0); // Position
output_low(PIN_C1); // Stop
output_low(PIN_C2); // DI
output_low(PIN_C3); // Fog
output_low(PIN_C4); // Reverse
output_low(PIN_A1); // Green sign
output_low(PIN_A5); // Red sign
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum