How it works...
We will define a variable called LED of the sbit type. The sbit type defines a bit within a special function register (SFR). We will set the LED variable to represent the 0th-bit position of port P1. Then, we will define a prototype of the Delay function, which takes an integer parameter but returns nothing. Within the main function, we will execute a while loop in an infinite loop. Within the while loop, we will set the LED variable to 0, that is, a LOW signal will be sent to the 0th bit of port P1.
Thereafter, we will introduce a delay through two nested loops. After the delay, we will set the value of the LED variable to 1, that is, a HIGH signal will be sent to the 0th bit of port P1. If the LED is connected to the 0th ...
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