• Finally found it! Try data.charAt(i) instead of data.charAt[i], or simply data[i] :)

  • doh! I used brackets instead of parentheses. data.charAt(i); works.

    Code:

    s7s.prototype.sendValue = function (data) {
      var a = this.address;
      var clr = this.displayTable.Clear; //Display clear command
      var dpc = this.displayTable.dp.cmd; //Decimal point command
      var dplo = this.displayTable.dp.location; //Decimal point location map
    
      var i;
      var length = data.length;
      var dpLoc;
      var value = "";
    
      for(i=0; i<length; i++) {
        var char = data.charAt(i);
    
        if(char != ".") {
          value += char;
        }
    
        if(char == ".") {
          dpLoc = i;
        }
      }
    
      I2C1.writeTo(a, clr); //Clear display
      I2C1.writeTo(a, value);
    
      if(typeof dpLoc !== 'undefined') {
        I2C1.writeTo(a, dpc);
        I2C1.writeTo(a, dplo[dpLoc - 1]);
      }
    };
    
About

Avatar for Manxome @Manxome started