Using servos in scratch

Proftechno21

New Member
I am a french teacher. I am using the new AXE401 board with S2P and scratch.

I am planing to use servos with a shield board (AXE405 ?)
I can't find a way to drive a servo.
The basic code (found in SERVO basic command, page 211):
servo B.0,75
servopos B.0,150
works fine.
In scratch if i use the 'BASIC' field with
servopos B.0,75
nothing works.

Is there a way to use servos with scratch ?
 

hippy

Ex-Staff (retired)
Staff member
Welcome to the PICAXE forum.

Servos are only activated when a SERVO command has been used; SERVOPOS on its own will not activate servos so you would have to issue a SERVO command in Scratch as in Basic programming.

An additional problem arises depending on how Scratch is being used. If used interactively with a PICAXE via S2P connect mode - that is programs running in the Scratch Editor control the PICAXE - the mechanism used to achieve that requires the PICAXE to always be waiting for commands from Scratch, and while doing that it is not able to update the background servo handling so servos will not work.

It should be possible to use servos in an appropriate Scratch program by saving the Scratch program and using S2P to convert that to a program which is then downloaded to the PICAXE and run on the PICAXE.
 

Proftechno21

New Member
Thank you for your answer.

I first try SERVO command via S2P connect mode.
When using S2P to download program to the PICAXE its works.
 
Top