[C.CC USERS] possible to drive 3 servos with concurrency at this stage?
Laurence Laycock
rencio7 at gmail.com
Sat Jul 31 19:22:10 BST 2010
Hi I have recently got 2 servos running nicely with code from here
http://concurrency.cc/blog/2010/07/08
<http://concurrency.cc/blog/2010/07/08>+ adding some more...superb stuff...
But is it possible right now to run 3 or more?
Here is the code for three....just a copy pasta adding more servos...don't
know if this is correct way to do this...
*#INCLUDE "plumbing.module"*
*
*
*PROC main ()*
* CHAN SERVO s:*
* CHAN SERVO s2:*
* CHAN SERVO s3:*
* SEQ*
* digital.mode (9,OUTPUT)*
* digital.mode (10,OUTPUT)*
* digital.mode (11,OUTPUT)*
* PAR*
* *
* servo (9, s?)*
* servo (10,s2?) *
* servo (11,s3?)*
* SEQ*
* s ! min ; 650*
* s ! max ; 2350*
* s ! div ; 4*
* s ! pos ; 0*
* s ! start*
* s2 ! min ; 2350*
* s2 ! max ; 650*
* s2 ! div ; 4*
* s2 ! pos ; 0*
* s2 ! start*
* s3 ! min ; 700*
* s3 ! max ; 650*
* s3 ! div ; 4*
* s3 ! pos ; 0*
* s3 ! start*
* delay (2000)*
* WHILE TRUE*
* SEQ*
* SEQ i = 0 FOR 4*
* SEQ*
* s ! pos ; i*
* s2 ! pos ; i*
* s3 ! pos ; i*
* delay (1000)*
* SEQ i=4 FOR 4 STEP -1*
* SEQ*
* s ! pos; i*
* s2 ! pos ; i*
* s3 ! pos ; i*
* delay (1000)*
:
Here is the error code from the arduino in occplug...
tvm-arduino: error status E
*Final machine state:*
*file=pwm.arch.module line=106*
*wptr=01c4 (rel=0019) iptr=d0a1 (rel=006d) eflags=0001 sflags=0000*
*areg=0000 breg=d119 creg=d119 oreg=0000*
*8000 8000 8000 8000 8000 8000 8000 wptr>0000 8000 0010 0081 0080 0036 d119
*
*f4 aa 79 21 c0 a1 0c 23 46 d5 21 f0 iptr>28 40 d0 28 48 d1 07 22 40 d0 28
4a *
any help would be greatly appreciated.
Laurence (:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.concurrency.cc/pipermail/users/attachments/20100731/1fade036/attachment.htm>
More information about the users
mailing list