Work on the badge from MCH2022
See Also:
See: https://www.badge.team/docs/badges/mch2022/software-development/
- Create this file:
/etc/udev/rules.d/99-mch2022.rules as sudo:
(find-file "/sudo:root@localhost:/etc/udev/rules.d/99-mch2022.rules")
- Add these lines:
SUBSYSTEM==”usb”, ATTR{idVendor}==”16d0”, ATTR{idProduct}==”0f9a”, MODE=”0666”
- Run
sudo udevadm control --reload-rules sudo udevadm trigger
- Plug in via usb-C and start the
python
app. Thenscreen /dev/ttyACM0 115200
which gives you a python prompt.
Note: To suspend the sesssion:
C-a d
, to resume:screen -r <TAB>
. To kill it from the outside:screen -X -S <TAB> quit
. - Enter
import display display.drawFill(0xd62728) # This is matplotlib's C3 (red) display.flush()
see the online API reference. For mch2022 specifics, see:
import mch22 dir(mch22) ['__class__', 'buttons', 'exit_python', 'fpga_disable', 'fpga_load', 'fpga_receive', 'fpga_send', 'fpga_send_turbo', 'fpga_transaction', 'get_brightness', 'lcd_mode', 'read_vbat', 'read_vusb', 'set_brightness', 'set_handler']
- Get the copy scripts
from github:
sudo -H pip3 install pyusb git -C mch2022 clone [email protected]:badgeteam/mch2022-tools.git
- See what is on the batch
cd mch2022-tools python3 webusb_fat_ls.py /flash/
Booting into WebUSB, please wait …
████████████████████ 100.0% transfer speed: 1.28 kb/s Directory listing for ”flash“… Directory “apps” Directory “lib” Directory “cache” Directory “config”
https://www.badge.team/docs/esp32-platform-firmware/esp32-app-development/api-reference/display
- See here: https://www.badge.team/docs/badges/mch2022/software-development/micropython/neopixels/
- Code is here: mch2022/neopixels.py
- Copy it following the above steps:
python3 webusb_fat_mkdir.py /flash/apps/python/matplotlib_colors
Starting… /internal/apps/python/matplotlib_colors Succesfully created directory
python3 webusb_fat_push.py ../neopixels.py /flash/apps/python/matplotlib_colors/__init__.py
Booting into WebUSB, please wait …
████████████████████ 100.0% transfer speed: 33.90 kb/s File uploaded
- Some helpful API details