Hi everyone I am trying to get blinky to work on a PIC16F887 demoboard that comes with the PICKIT 2. I am using MPLABX.
I have a variable called blink but I dont know how to "link" that variable to the LEDs. The variable is successfully shifting the bit along one each time but it isnt lighting up any LEDs. How do I alter the variable so that it affects the LEDs?
Here is my code:
/*
* File: Lab1inC1.c
* Author: David Baratheon
*
* Created on 16 June 2013, 21:22
*/
#include <xc.h>
void main(void){
char Blink;
char Counter;
while(1){
Blink = 0x01;
Counter = 0x00;
while(Counter<7){
Blink = Blink << 1; //
Counter++ ;
CLRWDT();
}
}
}
I have a variable called blink but I dont know how to "link" that variable to the LEDs. The variable is successfully shifting the bit along one each time but it isnt lighting up any LEDs. How do I alter the variable so that it affects the LEDs?
Here is my code:
/*
* File: Lab1inC1.c
* Author: David Baratheon
*
* Created on 16 June 2013, 21:22
*/
#include <xc.h>
void main(void){
char Blink;
char Counter;
while(1){
Blink = 0x01;
Counter = 0x00;
while(Counter<7){
Blink = Blink << 1; //
Counter++ ;
CLRWDT();
}
}
}
Last edited: