🏍️ Fixed servos svelte

This commit is contained in:
Niklas Jensen
2026-01-02 19:25:01 +01:00
committed by nikguin04
parent 72cde1a90a
commit ff3a3f3d7d
4 changed files with 220 additions and 6 deletions
@@ -12,16 +12,16 @@
const throttler = new Throttler()
const activateServo = () => {
socket.sendEvent(ServoStateData, { active: 1 })
socket.sendEvent(ServoStateData, ServoStateData.create({active: true}))
}
const deactivateServo = () => {
socket.sendEvent(ServoStateData, { active: 0 })
socket.sendEvent(ServoStateData, ServoStateData.create({active: false}))
}
const updatePWM = () => {
throttler.throttle(() => {
socket.sendEvent(ServoPWMData, { servo_id: servoId, pwm })
socket.sendEvent(ServoPWMData, ServoPWMData.create({ servoId: servoId, servoPwm: pwm }))
}, 10)
}