#include "avr/io.h"
main()
{
unsigned char= z ;
for(z=0;z<200;z++)
PORTA=z; //PORTA dispalys the value of z
}
Please explain the working of the loop as z is char and is acting as int
#include "avr/io.h"
main()
{
unsigned char= z ;
for(z=0;z<200;z++)
PORTA=z; //PORTA dispalys the value of z
}
Please explain the working of the loop as z is char and is acting as int
Copyright © 2021 Jogjafile Inc.
char(and by extension,unsigned char) is an integral type. Anunsigned charcan hold values from 0 to 255.Characters are typically stored in
charvariables as well. What they actually store is the ASCII value of the character in question. For example:The variable
ccontains the value 65, which is the ASCII value ofA.In the case of this code, an
unsigned charvariable is being used in an integer context.