Hi all,
I am looking to move this servo from 0-270°: http://www.dfrobot.com/index.php?route=product/product&path=156_51_108&product_id=1177
Using the example code found in the developer docs I can not get it to move past 180° Would this be an error with my set frequency and/or duty cycle? My code is the 95% thesame as the example code. I changed the period to .02 and the MIN to .01. It looks like this:
`const SERVO_MIN = 0.01 //duty cycle .03 is default
const SERVO_MAX = 0.1
servo <- hardware.pin7
servo.configure(PWM_OUT, 0.02, SERVO_MIN)
server.log("Device Online!");
// expects a value between 0.0 and 1.0
function setServo(value) {
local scaledValue = value * (SERVO_MAX - SERVO_MIN) + SERVO_MIN
server.log(scaledValue)
servo.write(scaledValue)
}
function sweep() {
// Write the current position
local position = 0.0
for (local i = 0; i < 10; i++) {
setServo(position)
position = position + 0.1
imp.sleep(1.0)
}
}`
Thank you