![]() |
Sample Program
'************************************************************** ' ' Pulse Motor Driver Control Program Ver 0.1 ' ' 2001/7/9 Koichi Hirata, H. Sakakibara ' ' motwc01.bas ' '************************************************************** ' ' for AT90S2313-10PC ' '********************* ' Initial set '********************* ' Config Portb = Output Config Portd = Input 'Dim T As Integer ' '********************* ' Loop '********************* ' Do ' Portb.3 = 0 : Portb.2 = 0 : Portb.1 = 0 : Portb.0 = 0 'Left Wheel Portb.7 = 0 : Portb.6 = 0 : Portb.5 = 0 : Portb.4 = 0 'Right Wheel Wait 5 'Wait 1 sec Portb.3 = 1 : Portb.2 = 1 : Portb.1 = 0 : Portb.0 = 0 'Left Wheel Portb.7 = 0 : Portb.6 = 1 : Portb.5 = 0 : Portb.4 = 0 'Right Wheel Wait 5 Portb.3 = 0 : Portb.2 = 0 : Portb.1 = 0 : Portb.0 = 0 'Left Wheel Portb.7 = 0 : Portb.6 = 0 : Portb.5 = 0 : Portb.4 = 0 'Right Wheel Wait 5 'Wait 1 sec Portb.3 = 0 : Portb.2 = 1 : Portb.1 = 0 : Portb.0 = 0 'Left Wheel Portb.7 = 1 : Portb.6 = 1 : Portb.5 = 0 : Portb.4 = 0 'Right Wheel Wait 5 ' Loop End |
[ Microcomputer ] [ Hirata HOME ] [ Power and Energy Engineering Division ] [ NMRI HOME ] |
![]() |
Contact khirata@nmri.go.jp |