Created
June 17, 2016 11:45
-
-
Save raghavendrahassy/48af133158f274aee8f20e05a411a329 to your computer and use it in GitHub Desktop.
Explore Starter 8051 board has 2 user interface switches on the board which are connected to P3.2 and P3.3 . There are 4 LED's are on board which are also connected to higher four bits of P3. Out of these we will read the status of SW2 ( Connected to P3.3) and will show the status on LED ( Connected to P3.7).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <reg51.h> | |
sbit LED = P3^7; // LED is connected to P3.7 | |
sbit Switch = P3^3; // Switch is connected to P3.3 | |
int main() | |
{ | |
P3 = 0x08; // Switch declared as input and LED as output | |
while(1) | |
{ | |
LED = Switch; | |
} | |
return(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment