It's a bit of a hack at the moment - LEDs and Buttons are treated differently.
The best method is to make your own jswrap_xx.c file, and to put something like this in it:
jswrap_xx.c
/*JSON{ "type" : "variable", "name" : "ADC", "generate_full" : "JSH_PORTD_OFFSET+1", "return" : ["pin","My ADC"] }*/
@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.
It's a bit of a hack at the moment - LEDs and Buttons are treated differently.
The best method is to make your own
jswrap_xx.c
file, and to put something like this in it: