You are reading a single comment by @d0773d and its replies. Click here to read the full conversation.
  • 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);
    }
    
About

Avatar for d0773d @d0773d started