How it works...
We will define a variable, i, of the unsigned char type; a variable of the unsigned char type can store 256 bits, whereas that of a signed char can store only 128 bits. The i variable is assigned the HEX value of 0. We will set a while loop to execute infinitely. With every iteration of the while loop, the value of the i variable will increment by 1. Within the while loop, we will assign the value of the i variable, that is, 0, to port P3.
We will introduce a delay by using two nested for loops. Thereafter, we will execute a while loop again, incrementing the value of the i variable, making it 1. Again, we will assign the value of the i variable to port P3 for display. And, we will reintroduce some delay, followed by executing ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access