Avatar for AndyS

AndyS

Member since Mar 2017 • Last active Dec 2017
  • 1 conversations
  • 2 comments

Most recent activity

    • 4 comments
    • 2,870 views
  • in Other Boards
    Avatar for AndyS

    I am likely wrong here - but I'm trying to NOT use the full BLE stack. i.e. I'm looking to have two microbits communicate with each other, without having to pair them.

    I tried your suggestion - but it didn't work - I think this is because I'm looking to have two microbits communicating without a 'central' PC.

    Am I barking up the wrong tree - or is this something Espruino can do - i.e. radio comms without pairing.

    I do have this working in uPython now - but I would prefer to use Espruino - if possible.

    Best wishes
    Andy

  • in Other Boards
    Avatar for AndyS

    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(({receivedNumber: 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

Actions