You are reading a single comment by @AndyS and its replies. Click here to read the full conversation.
  • Hello Everyone
    Gordon has already kindly pointed me in the direction of more documentation. Unfortunately, I'm not an Espruino person - so I'm missing a lot of the background knowledge - so the Espruino radio api doesn't mean anything to me.

    Does anyone whether it is possible, or how, to access the radio from Espruino. As a example, I have a simple javascript (written for the blockly...microsoft editor) that follows:
    N.B. I know this won't work in Espruino...

    let x = 0
    let y = 0
    input.onButtonPressed(Button.B, () => {
        radio.sendNumber(x + 5 * y)
    })
    input.onButtonPressed(Button.A, () => {
        led.unplot(x, y)
        x += 1
        if (x > 4) {
            x = 0
            y += 1
            if (y > 4) {
                y = 0
            }
        }
        led.plot(x, y)
    })
    radio.onDataPacketReceived(({receivedNum­ber: recd}) => {
        y = recd / 5
        x = recd - y * 5
        led.plot(x, y)
    })
    x = 0
    y = -1
    radio.setGroup(4)
    

    Any hints, tips, tutorials or pointers to documentation would be very welcome.

    Best wishes
    Andy Stratton

About

Avatar for AndyS @AndyS started