DrAzzy, I added the function as you suggested. I then unplugged the board from the USB port and plugged the board back into the USB port, but the code does not seem to execute upon startup. My new code is:
var phValue="";
Serial4.setup(38400);
//Serial1.setup(9600/*baud*/);
Serial4.onData(function (e) {
phValue+=e.data;
if (e.data == "\r") {
print(phValue);
phValue="";
}
});
function getPhValue() {
on = !on;
digitalWrite(LED1, on);
Serial4.print("r\r");
}
function onInit() {
var interval = setInterval(getPhValue, 1500);
}
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
DrAzzy, I added the function as you suggested. I then unplugged the board from the USB port and plugged the board back into the USB port, but the code does not seem to execute upon startup. My new code is: