Try:
console.log((val*0.256/32768).toFixed(3) + "V");
You'll probably have to change 0.256 depending on the current gain of your ADC. The .toFixed(3) turns it into a string with 3 decimal places.
0.256
.toFixed(3)
@Gordon started
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.
Try:
You'll probably have to change
0.256
depending on the current gain of your ADC. The.toFixed(3)
turns it into a string with 3 decimal places.