JamesNewton / Arduino_Dynamixel_Stepper_Controller

USB adapter to Arduino with Dynamixel Shield provides simple digital IO and motion.
1 stars 0 forks source link

Negative servo positions #2

Open JamesNewton opened 3 years ago

JamesNewton commented 3 years ago

All other numbers in the system are positive long integers. e.g. pins can't be negative, delays can't go back in time, PWM values must be positive, etc... Servos /can/ go backwards.

Add an offset so that 0S actually goes to the maximum negative angle? That seems dangerous.

Add a '-' command that inverts n? e.g. 90-S

JamesNewton commented 2 years ago

Use a flag, and set it if we get a "-" while n is zero. Need to check that /before/ the main switch, before n is set to p. This overloads "-" because it's also used for high state in i2c diagrams.