bbcmicrobit / bbcmicrobit/micropython
radio.config queue parameter
- Dominant language
- C
- Stars
- 646
- Forks
- 290
- PR merge metrics
- No merged PRs in 30d
Description
The queue parameter in radio.config() does not seem to have an affect. Even when not set (and so the queue default is set to 3) the micro:bit seems to be able to store at least 10 messages in the queue.
# To recreate:
flash the contents of this script onto a micro:bit:
```
from microbit import *
import radio
# turn on the radio
radio.on()
cpt = 0
while True:
if button_a.was_pressed():
radio.send(str(cpt))
cpt = cpt + 1
sleep(100)
```
Then, by pressing A 5 times, send 5 different messages to another micro:bit set up to receive them - you will need to put into the terminal:
```
>>>from micro:bit import *
>>>import radio
>>>radio.config(queue=1)
>>>radio.receive()
0
>>>radio.receive()
1
>>>radio.receive()
2
etc
```
you should get at least 5 different messages, which shows more than 1 message is being stored on the queue.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.