servo


Author Message
georgestheking
Newbie

Joined: 21/12/2021
Location: Belgium
Posts: 27
Posted: 06:28pm 31 Oct 2024      

Hi,

I want to use servo on picomite.
I use the cytron maker board.

I understand that the syntax are :

PWM 6,50,chA,5+servo1*.25
PWM 6,50,chB,5+servo2*.25
PWM 7,50,chA,5+servo3*.25
PWM 7,50,chB,5+servo4*.25

I try also DutyA

But it does not work.

Best regards,

Georges

matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9425
Posted: 07:41pm 31 Oct 2024      

What specific version of the firmware are you using? Let me know and I'll post a version with a specific SERVO command for you to play with/test.

georgestheking
Newbie

Joined: 21/12/2021
Location: Belgium
Posts: 27
Posted: 07:45pm 31 Oct 2024      

Hi,

I use version 5.08 on picomite RP2040.
Servo need a 1 ms to 2 ms pulse every 20 ms.

Thanks for your help,

Georges
Edited 2024-11-01 05:55 by georgestheking

matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9425
Posted: 07:50pm 31 Oct 2024      

Try this


PicoMite.zip


Set the pins you want as PWM outputs e.g.

SETPIN GPn,PWM

Then use the servo command

SERVO channel, posA [,posB]

posA and posB can be between -20.0 and 120.0%

Make sure you understand which pins are on which PWM channel (see manual) and note that you can omit posA or posB but not both and if you want just posB then include the extra comma

e.g.

SERVO channel,,posB

This functionality will be part of the 6.00.00 release when finalised
Edited 2024-11-01 05:53 by matherp

stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2260
Posted: 08:48pm 31 Oct 2024      

  matherp said  Try this


PicoMite.zip


Set the pins you want as PWM outputs e.g.

SETPIN GPn,PWM

Then use the servo command

SERVO channel, posA [,posB]

posA and posB can be between -20.0 and 120.0%

Make sure you understand which pins are on which PWM channel (see manual) and note that you can omit posA or posB but not both and if you want just posB then include the extra comma

e.g.

SERVO channel,,posB

This functionality will be part of the 6.00.00 release when finalised


I always used pulse out gcb to control mini servo. not tried on mmbasic, never thought of pwm. 1.5ms is mid position 1ms left to 2 ms right every 20 ms