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.
But if you just give him working code what will
wuchy have learned ?
Your right I think I'll just go back to writing code for myself and let these forums go. Just read and stop posting
Right But I want to catch them to not just show how to bait the hook LOLBut teaching people to fish is better then giving them the fish.... right ?
#define LCD_E RB7_bit
#define LCD_RW RB6_bit
#define LCD_RS RB5_bit
void MicroStrobe(void);
void main() {
ANSEL = 0; // Configure AN pins as digital
ANSELH = 0;
C1ON_bit = 0; // Disable comparators
C2ON_bit = 0;
TRISA = 0x00;
TRISB = 0x00;
TRISC = 0x00;
TRISD = 0x00;
PORTA = 0x00;
PORTB = 0x00;
PORTC = 0x00;
PORTD = 0x00;
/********** INITIALIZATION ***************************/
LCD_RW = 0;
LCD_RS = 0;
PORTA = 0b00110000;
MicroStrobe();
Delay_ms(10);
PORTA = 0b00110000;
MicroStrobe();
Delay_us(125);
PORTA = 0b00110000;
MicroStrobe();
Delay_us(125);
PORTA = 0b00111000; //Function Set
MicroStrobe();
Delay_us(60);
PORTA = 0b00001000; //Display off
MicroStrobe();
Delay_us(60);
PORTA = 0b00000001; //Display Clear
MicroStrobe();
Delay_ms(2);
PORTA = 0b00000110; //Entry mode set
MicroStrobe();
Delay_us(60);
PORTA = 0b00001111; //turning display, cursor, and blink ON
MicroStrobe();
Delay_us(60);
PORTA = 0b00000010; //return to home
MicroStrobe();
Delay_ms(2);
/******************** displaying text *************************/
LCD_RS = 1;
while(1){
PORTA = 0b00110000; //Code for a "0"
MicroStrobe();
PORTA = 0b00110001; //Code for a "1"
MicroStrobe();
PORTA = 0b00110010; //Code for a "2"
MicroStrobe();
PORTA = 0b00110011; //Code for a "3"
MicroStrobe();
PORTA = 0b00110100; //Code for a "4"
MicroStrobe();
PORTA = 0b00110101; //Code for a "5"
MicroStrobe();
PORTA = 0b00110110; //Code for a "6"
MicroStrobe();
PORTA = 0b00110111; //Code for a "7"
MicroStrobe();
PORTA = 0b00111000; //Code for a "8"
MicroStrobe();
PORTA = 0b00111001; //Code for a "9"
MicroStrobe();
Delay_ms(1000);
}
}
void MicroStrobe(void){
LCD_E = 1;
Delay_ms(1);
LCD_E = 0;
}
Your right I think I'll just go back to writing code for myself and let these forums go. Just read and stop posting