News Update :

running Led AT 89s51 / AT 89s52 / AT 89c51 / MCS51




Running LED atau biasa disebut dengan LED berjalan. kali ini yang aku posting menggunakan IC AT 89s51 / AT 89s52 / AT 89c51 / MCS51

Caranya Hubungkan Port 3 dengan Led, dan pus buttom pada port 1.0.
kemudian simpan program dibawah ini dalam format BAS, dan gunakan Bascom 8051 untuk meng-compile program tersebut

Do

If P1.0 = 0 Then
Mulai:

P3 = &B01111110
Waitms 200
P3 = &B10111101
Waitms 200
P3 = &B11011011
Waitms 200
P3 = &B11100111
Waitms 200
P3 = &B11011011
Waitms 200
P3 = &B10111101
Waitms 200
If P1.0 = 0 Then Goto Lai
Goto Mulai



Lai:
P3 = &B00000011
Do
Rotate P3 , Left
Waitms 200
Loop Until P3 = &B11000000
Do
Rotate P3 , Right
Waitms 200
Loop Until P3 = &B00000011
If P1.0 = 0 Then Goto Ai
Goto Lai


Ai:
P3 = &B00000111
Do
Rotate P3 , Left
Waitms 200
Loop Until P3 = &B11100000
Do
Rotate P3 , Right
Waitms 200
Loop Until P3 = &B00000111
If P1.0 = 0 Then Goto Mulai
Goto Ai
End If

Tidak ada komentar:

Posting Komentar

 
Company Info | Contact Us | Privacy policy | Term of use | Widget | Advertise with Us | Site map
Copyright © 2011. elektra solution . All Rights Reserved.
Design Template by panjz-online | Support by creating website | Powered by Blogger