In: Computer Science
convert the code to the flow chart
char counter;
void wait() {
delay_ms(1000);
}
void main() {
TRISB=0x00; // set direction to be output
PORTA=0x00; // turn off the PORTA leds
PORTB=0x00; // turn off the PORTB leds
PORTC=0x00; // turn off the PORTC leds
PORTD=0x00; // turn off the PORTD leds
while (1){
for (counter = 15; counter>0 ; counter= --) {
PORTB = counter;
wait();
}
}
}
Flowchart is graphical representation of given algorithm.
Flowchart: Following symbol is used in flow chart
|
Use to Indicate starting and ending of Flowchart. This is oval shape. |
|
Used to check any condition. For which there are two answer true or false. This is diamond shapes. |
|
Parallelograms are used to read input data and display informations. |
|
Flow lines used to connect symbol used in flowchart and indicate direction of flows. |
|
This shape takes two names - 'Subroutine' or 'Predefined Process'. This allows you to write one subroutine and call it as often as you like from anywhere in the code. |
The flow chart for given code is below first is for function definition in which observe carefully there is return statement no stop symbol.
And second one is main flowchart from where we call the function and perform remaining operation.
At any point if you have any query feel free ask me.