Maeve works her embroidery magic:
Visitors from American College of Sofia
Team Robo Dog: Successful Test of Mechanism
- Drag the set pull block from the Pins menu (under "Advanced").
- Select the specific pin (e.g.,
P0) and set the pull mode to Up.

When using radio.sendValue("name", value) in MakeCode, getting garbled, dropped, or "ghost" data is a common frustration. It almost always boils down to how the micro:bit's radio chip handles rapid-fire packets, strict memory limits, or crowded airwaves.
Here is exactly what causes the data to corrupt and how to fix it:
1. The forever Flood (Data Collisions)
If you place your radio.sendValue() block inside a forever loop without a delay, your micro:bit attempts to blast hundreds of packets per second into the air.
When it does this, two things happen:
Packet Collisions: If two micro:bits broadcast at the exact same millisecond, their radio waves physically interfere, scrambling the packet mid-air.
Buffer Overload: The receiving micro:bit simply can't process the incoming data fast enough. Its memory buffer fills up, causing it to drop parts of the message or merge old data with new data.
The Fix: Always give the radio time to breathe. Add a pause block (even just 50 to 100 milliseconds) immediately after sending data.
2. The 8-Character Name Limit (Truncation)
Because the micro:bit uses very small data packets to save memory, radio.sendValue() is heavily restricted.
By design, the name string portion can only be 8 characters long (though some older MakeCode versions allowed 12). If you try to send a name like "temperature", MakeCode abruptly chops the word off because it exceeds the limit. The receiver might get "temperat", which looks garbled and will fail if your receiving code is checking for the full word "temperature".
The Fix: Use short, abbreviated names for your values. Instead of "temperature", use "temp". Instead of "player1score", use "p1".
Adding a pause between packets worked!
























.png)








No comments:
Post a Comment