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.
unsigned char i;
bit oldstate; // Old state flag
void main() {
OSCCAL = 0b11111101; // calibrate internal osilator 4 MHz
CMCON = 0b00000100; // CIN- analog, Internal VRef
GPIO = 0; //<<<<<<added
TRISIO = 0b00000010; // gp2 = output
VRCON = 0b10101111; // sets Vref
gpio.F2 = 0;