class DataField extends Ui.SimpleDataField {
var result ="";
var last_result ="";
// Constructor
function initialize() {
label = "Field";
}
// Handle the update event
function compute(info) {
//some stuff to calculate result
answer = position;
if (result != last_result) { Attention.playTone(2);
}
last_result = result;
return result;
}
}
But in the simulator it plays the beep whether or not the field changes value. Even if I output the result and last result and can see that they are the same. What am I missing?
Also is that the best way of getting a beep. It appears to make the 520 crash.