' ******************************************** ' * ((IN THE NAME OF GOD)) * ' ******************************************** ' * Title : LED Mover * ' * Date : 1385/5/16 * ' * Target : Atmega8L * ' * Program code : BASCOM AVR * ' * Author : Foad Alikhani * ' * WebSite : Www.Mechatronics.Co.Sr * ' * E-mail : foad_8x@yahoo.com * ' ******************************************** $regfile = "m8def.dat" $crystal = 4000000 Dim X As Byte , Y As Byte , Z As Byte Config Portb = Output 'left to right Portb = 0 ' set PORTB to 0 (GND) For X = 1 To 255 For Y = 0 To 7 Portb = 0 Portb.y = 1 Waitms 40 Next Y 'right to left For Y = 6 To 1 Step -1 Portb = 0 Portb.y = 1 Waitms 40 Next Y Portb.0 = 1 Next X End