WALRUS ( - )


12.07.2010, 19:54



. - . "walrus".

, , . 10 .

. "", , "" ( , , ). , , "".

, . , 2 .

, , "", 2 , , .

, , 2.5 6 . 2.5, ( :-) ).

. , . 4 , - I2C, LCD.

:

320200, GIF-: walrus_motion1.gif (270 )
640x400, MPEG: walrus1.mpg (2.8 )

. , :

Config Servos = 4 , Servo1 = Portd.2 , Servo2 = Portd.3 , Servo3 = Portd.0 , Servo4 = Portd.4 , Reload = 10
Config Portd = Output

Dim Minimum As Byte
Dim Maximum As Byte
Dim N As Integer
Dim Center As Byte

Minimum = 80
Maximum = 180
Const Wait1 = 500
Center = Maximum - Minimum
Center = Center / 2
Center = Center + Minimum

Const Top = 50
Const Forward = 40
Const Back = 20

'finally we must turn on the global interrupt
Enable Interrupts

'the servo() array is created automatic. You can used it to set the
'time the servo must be on

' init
Servo(1) = Center
Servo(2) = Center
Servo(3) = Center
Servo(4) = Center
Waitms Wait1


Do
' top
N = Center - Top
Servo(1) = N
N = Center + Top
Servo(4) = N
Servo(2) = Center
Servo(3) = Center
Waitms Wait1
' forward
N = Center - Top
Servo(1) = N
N = Center + Top
Servo(4) = N
N = Center + Forward
Servo(2) = N
N = Center - Forward
Servo(3) = N
Waitms Wait1
' top
Servo(1) = Center
Servo(4) = Center
N = Center + Forward
Servo(2) = N
N = Center - Forward
Servo(3) = N
Waitms Wait1
Servo(1) = Center
Servo(2) = Center
N = Center - Back
Servo(2) = N
N = Center + Back
Servo(3) = N
Waitms Wait1

Loop

 

15.12.2005.


:
Servo
Center
Waitms
Wait1
Portd
Const
Forward
Maximum
Byte
Minimum
servo
WALRUS ( - )


:



! !
:

.