Mapping Tilt to Servo Angle

Microsoft's MakeCode platform for easy blocks-style programming

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
KathyCeceri
 
Posts: 54
Joined: Sun Mar 02, 2014 7:30 pm

Mapping Tilt to Servo Angle

Post by KathyCeceri »

Hi! I am trying to do the Tilt Maze project (https://learn.adafruit.com/tilt-controlled-marble-maze) in MakeCode by mapping tilt (pitch/roll) to servo angle.

I've mapped pitch/roll in other projects (https://learn.adafruit.com/cpx-musical-glove) but it is not working very well for this one. The servos get jittery, or don't tilt as much in one direction as the other. Any thoughts? I'm attaching a screengrab of my code. You can open it here: https://makecode.com/_AR57KxaA75m0

Video of it working using the "on tilt" blocks here: https://vimeo.com/705803902
Attachments
00-MazeGame1000px.JPG
00-MazeGame1000px.JPG (63.39 KiB) Viewed 1035 times
TiltMazeMapping.png
TiltMazeMapping.png (180.97 KiB) Viewed 1035 times

User avatar
johnpark
 
Posts: 985
Joined: Wed Mar 25, 2009 2:15 pm

Re: Mapping Tilt to Servo Angle

Post by johnpark »

One thing to try is use the set servo __ pulse to 1500µs block in your start loop to set a different value for your specific servos.

Locked
Please be positive and constructive with your questions and comments.

Return to “MakeCode”