Wednesday, 24 July 2024

Code Club Showcase Ideas

  • Use microbits for data gathering (well-known and easy) and ESP8266 for wifi to hub
    • microbit<->ESP8266 via serial port(s)
      • This is relatively simple
    • microbit<->ESP8266 via I2C!! An interesting idea 
      • Uses Wire() library on ESP, I2C on microbit
  • Experimenting with ESP32 microPython Bluetooth
    • Using ChatGPT (!) generated code - it refers to ble_advertising module
    • Didn't get that to work yet, in fact it gave wrong answers for the ESP32 code and the microbit code just wouldn't run
I found kaspersMicrobit, which allows my MBA to connect using BLE to a microbit running the UART service, and sending regular text strings. The maximum length of text appears to be 20 bytes. It's nice to get a success, but it would need to be ported to MicroPython, ESP32 version!

I have also tried using aioble, the MicroPython library to talk to the microbit. So far, I've managed to receive the integer from the temperature service. The UART service seems to require use of the notify and then some kind of transfer/read operation to get the text - there is no READ operation flag on it, only NOTIFY. I haven't worked out haw to do that with aioble yet. 

The V1 microbit runs out of memory pretty fast, I'm not sure how much you could do with it in respect of actually connecting sensors and so on.

No comments:

Post a Comment