Menu
support@nursinghomework.org
+1 714-215-3097

(Solved) : Write C Function Flash Given Number Leds Connected Portb Number Flashed 3 Times Time Follo Q35550407

  1. Write a C function to flash a given ‘number’ onLEDs connected to portb. The ‘number’ should be flashed 3 times,each time followed by 0x00. The time between flashes should be200mS. The prototype for the function is asfollows;

void Flash_Number(unsignedchar number);

You should write the Ccode for the function then show an example of how the function iscalled.

ii- Some pins on the PIC16F84A microcontroller havetwo functions. Give an example of this and for your example explainboth functions.

iii- Given porta is configured as all inputs.Explain the purpose of the following line of code and give onealternative way of writing this line of code.

while(!porta);

iv- Given porta is configured as all inputs andportb as all outputs while ‘count’ is a variable of type unsignedchar, draw a flowchart that describes the design of the following Ccode listing;

if(porta.0)

{

           count++;

portb =count;

}

else

{

           if (count != 0)

                       count = count-1;

           portb = count;

           }

delay_ms(200);

           portb = 0x00;

delay_ms(200);

Leave a Reply

Your email address will not be published. Required fields are marked *