Question: Can you provide me a flowchart for this code? #include #include #pragma config PBADEN = OFF #pragma config FOSC = HS #pragma config PWRT =

Can you provide me a flowchart for this code? #include
#include
#pragma config PBADEN = OFF
#pragma config FOSC = HS
#pragma config PWRT = OFF
#pragma config BOR = OFF
#pragma config ICPRT = OFF
#pragma config LVP = OFF
#pragma config WDT = OFF
#pragma config DEBUG = OFF
#pragma config CPUDIV = OSC1_PLL2
#define _XTAL_FREQ 8000000
unsigned char c;
volatile unsigned int x =0;
void send_data(unsigned char c){
TRISB =0;
PORTB =0;
PORTBbits.RB4=1;
PORTBbits.RB5=0;
PORTB = PORTB |(c>>4);
PORTBbits.RB5=1;
__delay_us(40);
PORTBbits.RB5=0;
PORTB= PORTB & 0xF0;
PORTB= PORTB |(c & 0X0F);
PORTBbits.RB5=1;
__delay_us(40);
PORTBbits.RB5=0;
__delay_us(400);
}
void send_cmd(unsigned char c){
TRISB =0;
PORTB =0;
PORTBbits.RB4=0;
PORTBbits.RB5=0;
PORTB = PORTB |(c>>4);
PORTBbits.RB5=1;
__delay_us(40);
PORTBbits.RB5=0;
PORTB= PORTB & 0xF0;
PORTB= PORTB |(c & 0X0F);
PORTBbits.RB5=1;
__delay_us(40);
PORTBbits.RB5=0;
__delay_us(400);
}
void LCD_INIT(){
send_cmd(0x30);
send_cmd(0x20);
send_cmd(0x28);
send_cmd(0x01);
send_cmd(0x06);
send_cmd(0x0C);
}
void main(void){
LCD_INIT();
while (1){
send_cmd(0x01);
send_data((x /10)+'0');
send_data((x %10)+'0');
__delay_ms(300);
x+=10;
if (x ==100){ x =0; }}
return;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!