Created
November 30, 2012 16:40
-
-
Save rafalw/4176861 to your computer and use it in GitHub Desktop.
Test ATmega48P - BASCOM
This file contains 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
' Test mikrokontrolera ATmega48P | |
' - zapalające się kolejno diody LED... | |
$regfile = "m48pdef.dat" | |
$Crystal=4000000 | |
$hwstack=40 | |
$swstack=16 | |
$framesize=32 | |
Config Timer1 = Timer , Prescale = 64 | |
Config Portc = &B0111111 | |
Portc = &B0000000 | |
Enable Interrupts | |
Enable Timer1 | |
On Timer1 Do_light | |
Dim A As Byte | |
Do | |
' Nic się tu nie dzieje... | |
Loop | |
End | |
Do_light: | |
If A = 0 Then | |
Portc = &B0000001 | |
Elseif A = 1 Then | |
Portc = &B0000010 | |
Else | |
Portc = &B0000100 | |
End If | |
Incr A | |
A = A Mod 3 | |
Return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment