I have a pulse variable and i'm trying to create buttons to increase and decrease the pulse variable by 100. However it cannot get higher / lower than a certain number. I made two functions that are called when the buttons are pressed however it doesn't seem to work.
function moveServoDown(widgetID){
current = parseInt(widgetGetString(widgetID));
if (current == 100) {
max = " - MAX";
}
else {
move = current + 100;
widgetSetString(widgetID, move);
}
document.getElementById("ServoPosition").innerHTML = current + "°" + max;
}
function moveServoUp(widgetID){
current = parseInt(widgetGetString(widgetID));
if (current == 1100) {
max = " - MAX";
}
else {
move = current - 100;
widgetSetString(widgetID, move);
}
document.getElementById("ServoPosition").innerHTML = current + "°" + max;
}
any idea what's wrong?