bagusdj
Member level 3
- Joined
- Nov 25, 2012
- Messages
- 67
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 1,766
Hi guys, i want to ask about programming my at89s52 using Keil c51 with clock frequency 11.0592MHz
the idea is to interface led so it will blink for 5 second,and then off for 5 second as well. in the same circuit, i also required to interface led that will light on if I hit a switch.
here is my circuit :
as seen above i want to blink led on P0. then the led on P1 should on when i hit switch on P2.
I search through internet and get 2 codes. each is for each function (blink and switch). Can anyone help me how to make it into a single file?
here is the code for blink:
and here is for switch:
Thank you in advance
the idea is to interface led so it will blink for 5 second,and then off for 5 second as well. in the same circuit, i also required to interface led that will light on if I hit a switch.
here is my circuit :
as seen above i want to blink led on P0. then the led on P1 should on when i hit switch on P2.
I search through internet and get 2 codes. each is for each function (blink and switch). Can anyone help me how to make it into a single file?
here is the code for blink:
and here is for switch:
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 #include<reg52.h> void main() { unsigned char temp; P1=0Xff; P2=0Xff; while(1) { temp=P2; P1=temp; while(P2==temp); } }
Thank you in advance
Last edited by a moderator: