Did you just add:
function cmd(c){cs.reset();dc.reset();spi.write(c);cs.set();} function dispoff(){cmd(0xae);} function dispon(){cmd(0xaf);}
If it doesn't work, my guess is because you haven't defined cs, dc, or spi variables?
cs
dc
spi
It might actually be you don't have a cs line, in which case you can reduce the whole command to spi.write(0xae,dc);
spi.write(0xae,dc);
@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.
Did you just add:
If it doesn't work, my guess is because you haven't defined
cs
,dc
, orspi
variables?It might actually be you don't have a
cs
line, in which case you can reduce the whole command tospi.write(0xae,dc);