Revision: 1614
Author: [email protected]
Date: Thu Jan 21 18:22:17 2010
Log: servo filename mistake
http://code.google.com/p/jallib/source/detail?r=1614
Added:
/trunk/include/external/motor/servo/servo.jal
Deleted:
/trunk/include/external/motor/servo/servo_control.jal
=======================================
--- /dev/null
+++ /trunk/include/external/motor/servo/servo.jal Thu Jan 21 18:22:17 2010
@@ -0,0 +1,70 @@
+-- Title: servo control library
+-- Author: Matthew Schinkel - borntechi.com, copyright (c) 2009, all
rights reserved.
+-- Adapted-by:
+-- Compiler: >=2.4m
+--
+-- This file is part of jallib (http://jallib.googlecode.com)
+-- Released under the ZLIB license
(http://www.opensource.org/licenses/zlib-license.html)
+--
+-- Description: This library moves a servo such as a servo used in radio
control (RC)
+--
+-- Sources:
+--
http://www.horrorseek.com/home/halloween/wolfstone/Motors/svoint_RCServos.html
+--
+-- notes:
+-- procedure run_servo must be continuously called within your main
program loop
+--
+-- choose speed to clock the servo:
+-- SERVO_USE_TIMER = TRUE - reduces delay in main program (ie. fastest
program)
+-- SERVO_USE_TIMER = FALSE - high value = slow servo clock, (slowest
program) / low value = fast servo, (fast program)
+-- SERVO_USE_TIMER = TRUE - low value = fast servo clock, (slow program)
/ high value = slow servo clock (fastest program)
+-- if SERVO_DELAY is too low with SERVO_USE_TIMER = TRUE you may get weird
movments
+--
+
+
+const word servo_values = servo_max - servo_min
+
+if SERVO_USE_TIMER == TRUE then
+ procedure run_servo(word in value) is
+ if (check_delay(0)) then
+ var word calc1, calc2
+ var word final
+ var byte final2
+
+ ;calculate the pulse length
+ calc1 = (value * 180)
+ calc2 = calc1 / 255
+ final = calc2 + servo_min
+
+ -- change final into a byte
+ var byte val[2] at final
+ final2 = val[0]
+
+ set_delay(0, servo_delay) -- 4 ticks on delay-slot 0
+ servo = on -- start the pulse
+ delay_10us(final2) -- move the servo by pulse length
+ servo = off -- end the pulse
+ end if
+ end procedure
+else
+ procedure run_servo(word in value) is
+ var word calc1, calc2
+ var word final
+ var byte final2
+
+ ;calculate the pulse length
+ calc1 = (value * 180)
+ calc2 = calc1 / 255
+ final = calc2 + servo_min
+
+ -- change final into a byte
+ var byte val[2] at final
+ final2 = val[0]
+
+ servo = on -- start the pulse
+ delay_10us(final2) -- move the servo by pulse length
+ servo = off -- end the pulse
+ delay_1ms(SERVO_DELAY) -- the rest of the servo pulse
+ end procedure
+end if
+
=======================================
--- /trunk/include/external/motor/servo/servo_control.jal Thu Jan 21
12:21:44 2010
+++ /dev/null
@@ -1,70 +0,0 @@
--- Title: servo control library
--- Author: Matthew Schinkel - borntechi.com, copyright (c) 2009, all
rights reserved.
--- Adapted-by:
--- Compiler: >=2.4m
---
--- This file is part of jallib (http://jallib.googlecode.com)
--- Released under the ZLIB license
(http://www.opensource.org/licenses/zlib-license.html)
---
--- Description: This library moves a servo such as a servo used in radio
control (RC)
---
--- Sources:
---
http://www.horrorseek.com/home/halloween/wolfstone/Motors/svoint_RCServos.html
---
--- notes:
--- procedure run_servo must be continuously called within your main
program loop
---
--- choose speed to clock the servo:
--- SERVO_USE_TIMER = TRUE - reduces delay in main program (ie. fastest
program)
--- SERVO_USE_TIMER = FALSE - high value = slow servo clock, (slowest
program) / low value = fast servo, (fast program)
--- SERVO_USE_TIMER = TRUE - low value = fast servo clock, (slow program)
/ high value = slow servo clock (fastest program)
--- if SERVO_DELAY is too low with SERVO_USE_TIMER = TRUE you may get weird
movments
---
-
-
-const word servo_values = servo_max - servo_min
-
-if SERVO_USE_TIMER == TRUE then
- procedure run_servo(word in value) is
- if (check_delay(0)) then
- var word calc1, calc2
- var word final
- var byte final2
-
- ;calculate the pulse length
- calc1 = (value * 180)
- calc2 = calc1 / 255
- final = calc2 + servo_min
-
- -- change final into a byte
- var byte val[2] at final
- final2 = val[0]
-
- set_delay(0, servo_delay) -- 4 ticks on delay-slot 0
- servo = on -- start the pulse
- delay_10us(final2) -- move the servo by pulse length
- servo = off -- end the pulse
- end if
- end procedure
-else
- procedure run_servo(word in value) is
- var word calc1, calc2
- var word final
- var byte final2
-
- ;calculate the pulse length
- calc1 = (value * 180)
- calc2 = calc1 / 255
- final = calc2 + servo_min
-
- -- change final into a byte
- var byte val[2] at final
- final2 = val[0]
-
- servo = on -- start the pulse
- delay_10us(final2) -- move the servo by pulse length
- servo = off -- end the pulse
- delay_1ms(SERVO_DELAY) -- the rest of the servo pulse
- end procedure
-end if
-
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jallib?hl=en.