You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Espruino won't be doing it in 2 steps, but chances are it's fast enough that you won't notice the LED going out for a fraction of a second and then going back on - however doing read then write isn't guaranteed to give you the results you want (if you do it on an IO pin that's shorted to ground you'll always get 0 returned).

    Honestly, I would do it in software. However if you're just wanting to play around with hardware, you're after the OUT register under GPIO in http://infocenter.nordicsemi.com/pdf/nRF52832_PS_v1.0.pdf

    That's at address 0x50000504, so you just do peek32(0x50000504) and you'll get a number representing the output state of all pins.

    On Puck.js it looks like you're using pin D5 - so it's the 5th bit (counting from 0), so to get the value you want something like (peek32(0x50000504)>>5)&1.

About

Avatar for Gordon @Gordon started