Busylight firmware for Raspberry Pi Pico

Rasperry Pi Pico Busylight

This is the GitHub repository for the project: https://buildcomics.com/ (TO Be Determined)
You will also find the "instructions" there!

Models

Find all the models for the Busylight here: https://www.prusaprinters.org/prints/64085-raspberry-pi-pico-busylight

Bill Of Materials (BOM)

  1. 1 x Raspberry Pi pico
  2. 1 x 5mm RGB led common cathode
  3. 1 x 86 Ohm 1/4w resistor
  4. 1 x 15 Ohm 1/4w resistor
  5. 1 x 39 Ohm 1/4w resistor
  6. The models (see above) 3d Printed

Wiring

I used one common cathode RGB LED 5mm wired with resistors. The led pinout goes as follows, counted from pin 1 as being the pin closest to the flat in the bottom of the LED:\ (Note, some RGB LEDS are wired Red, GND, Green, Blue)!

  1. Pin 1:RED, 68 ohm ==> GPIO 5
  2. Pin 2:CC, ==> GND
  3. Pin 3:BLUE, 15 ohm ==> GPIO 6
  4. Pin 4:GREEN, 39 ohm ==> GPIO 7

Note, the GPIO pins are based on the following piece of code in main.c. You can freely change these (apart from GPIO 0 & 1) by changing this code:

#define LED_1_RED_GPIO 5
#define LED_1_GREEN_GPIO 7
#define LED_1_BLUE_GPIO 6

Basic installation

  1. Download main.uf2 from the releases page: https://github.com/buildcomics/Busylight/releases
  2. Press the button on your raspberry pi Pico, and then connect it to your computer
  3. copy the "main.uf2" from the release page to the "RPI2" that shows up as a mass storage usb devcie
  4. To run this with your UC program, you need to download the appropriate driver from: https://www.plenom.com/downloads/download-software/ \

Main Code

The main code is based on Tinyusb: https://github.com/hathach/tinyusb
The device mimics a Plenom Kuando Busylight Omega model
I used https://github.com/mitrefccace/busylightapi as a reference to reverse engineer the protocol

Compiling the code

If you want to change the code and nteed to compile it, do the following: Assuming you have the raspberry pi pico c SDK installed(https://github.com/raspberrypi/pico-sdk)
The following (standard) commands will create "main.uf2" that can be copied onto the raspberry pi in bootsel mode:

  1. git clone [email protected]:buildcomics/Busylight.git
  2. cd Busylight
  3. mkdir build
  4. cd build
  5. cmake ..
  6. make
  7. Now press the button on your raspbery pi pico, connect it and copy the main.uf2 to the pico that should show up ass a mass storage device

Testing

Command to test HID descriptor of file:
sudo usbhid-dump -a 1:58 | grep -v : | xxd -r -p | hidrd-convert -o spec
using the hidrd tool from: https://github.com/DIGImend/hidrd

License

MIT License

Copyright (c) 2021 buildcomics

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Owner
Build Comics
Build Comics
Build Comics
Similar Resources

🦠 µnix is a UNIX-like operating system for the raspberry pi pico.

🦠 µnix is a UNIX-like operating system for the raspberry pi pico.

The µnix Operating System "µnix", "munix" or, "micro unix" aims to be a micro kernel based operating system targeting the Raspberry Pi Pico. "µnix" is

Dec 11, 2022

Fractal rendering for Raspberry Pi Pico microcontroller

picofract Mandelbrot Set rendering demo for Raspberry Pi Pico microcontroller with Pico Display Pack. Building If you already have the Pimoroni SDK bu

Dec 7, 2022

Arduino API for the Raspberry Pico

Raspberry PI Pico - Arduino API On Friday I was receiving my Raspberry PI Pico and I had the opportunity to play around with it. Actually most of the

Jan 2, 2023

x86 emulator on Raspberry Pi Pico

x86 emulator on Raspberry Pi Pico

picox86 x86 emulator on Raspberry Pi Pico https://user-images.githubusercontent.com/10139098/110543817-13299080-812b-11eb-9c88-674cdae919fc.mp4 PCB fr

Nov 9, 2022

A laser cut Dreamcast Pop'n Music controller and integrated memory card using the Raspberry Pi Pico's Programmable IO

A laser cut Dreamcast Pop'n Music controller and integrated memory card using the Raspberry Pi Pico's Programmable IO

Dreamcast Pop'n Music Controller Using Raspbery Pi Pico (RP2040) Intro This is a homebrew controller for playing the Pop'n Music games on the Sega Dre

Dec 29, 2022

Raspberry Pi Pico Arduino core, for all RP2040 boards

Raspberry Pi Pico Arduino core, for all RP2040 boards

Arduino-Pico Raspberry Pi Pico Arduino core, for all RP2040 boards This is a port of the RP2040 (Raspberry Pi Pico processor) to the Arduino ecosystem

Jan 5, 2023

A programming environment for Lua for the Raspberry Pi Pico microcontroller

picolua A programming environment for Lua for the Raspberry Pi Pico microcontroller. Version 0.3, April 2021 What is this? picolua is a proof-of-conce

Jan 8, 2023

a little hobby raspberry pi pico emulator

PICO-EMU a little raspberry pi pico emulator note: we use the provided bootrom from raspberry pi at the repo: https://github.com/raspberrypi/pico-boot

Nov 5, 2022

Raspberry Pi Pico AutoHotkey Streamdeck / Keyboard with LEDs

Raspberry Pi Pico AutoHotkey Streamdeck / Keyboard with LEDs

Dec 7, 2022
Comments
  • error: attempt to use poisoned resource & error: conflicting types

    error: attempt to use poisoned resource & error: conflicting types

    Hi using the instructions provided I have tried to build this repo for a different pinout on my rp-pico but it refused to build despite starting fresh multiple times, this is on a WSL2 instance of Ubuntu LTS 2204.

    the only code changed is the following:

    main.c: #define LED_1_RED_GPIO 18 #define LED_1_GREEN_GPIO 19 #define LED_1_BLUE_GPIO 20

    CMakeLists.txt: include(/mnt/c/Users/andrew.adams/Downloads/light/pico-sdk/pico_sdk_init.cmake)

    Cmake Output: https://pastebin.com/YcW3s63A

    build and error: https://pastebin.com/0xHp6wQA

  • Unable to compile on Windows or Linux

    Unable to compile on Windows or Linux

    Hello,

    as i got the wrong RGB led (common anode instead of cathode), i try my best to try to tweak the code to fix color issue that change involve.

    I try first without any change on your 1.01 version to compile on Windows without success. I try on Lubuntu after without success too ... My environement seems ok, because i can compile pico example without any issue ! Maybe you have an idea ? In which environement did you compile ?

    l[email protected]:~/pico/Busylight/build$ cmake .. Using PICO_SDK_PATH from environment ('../../pico-sdk') PICO_SDK_PATH is /home/lubuntu/pico/pico-sdk Defaulting PICO_PLATFORM to rp2040 since not specified. Defaulting PICO platform compiler to pico_arm_gcc since not specified. -- Defaulting build type to 'Release' since not specified. PICO compiler is pico_arm_gcc -- The C compiler identification is GNU 9.2.1 -- The CXX compiler identification is GNU 9.2.1 -- The ASM compiler identification is GNU -- Found assembler: /usr/bin/arm-none-eabi-gcc Defaulting PICO target board to pico since not specified. Using board configuration from /home/lubuntu/pico/pico-sdk/src/boards/include/boards/pico.h -- Found Python3: /usr/bin/python3.8 (found version "3.8.10") found components: Interpreter TinyUSB available at /home/lubuntu/pico/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; adding USB support. -- Configuring done -- Generating done -- Build files have been written to: /home/lubuntu/pico/Busylight/build [email protected]:~/pico/Busylight/build$ make -j4 Scanning dependencies of target bs2_default Scanning dependencies of target ELF2UF2Build [ 1%] Creating directories for 'ELF2UF2Build' [ 2%] Building ASM object pico-sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/compile_time_choice.S.obj [ 3%] Linking ASM executable bs2_default.elf [ 3%] Built target bs2_default [ 5%] No download step for 'ELF2UF2Build' Scanning dependencies of target bs2_default_padded_checksummed_asm [ 6%] Generating bs2_default.bin [ 7%] No patch step for 'ELF2UF2Build' [ 8%] Generating bs2_default_padded_checksummed.S [ 10%] No update step for 'ELF2UF2Build' [ 11%] Performing configure step for 'ELF2UF2Build' [ 11%] Built target bs2_default_padded_checksummed_asm -- The C compiler identification is GNU 9.3.0 -- The CXX compiler identification is GNU 9.3.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /home/lubuntu/pico/Busylight/build/elf2uf2 [ 12%] Performing build step for 'ELF2UF2Build' Scanning dependencies of target elf2uf2 [ 50%] Building CXX object CMakeFiles/elf2uf2.dir/main.cpp.o [100%] Linking CXX executable elf2uf2 [100%] Built target elf2uf2 [ 14%] No install step for 'ELF2UF2Build' [ 15%] Completed 'ELF2UF2Build' [ 15%] Built target ELF2UF2Build Scanning dependencies of target main [ 16%] Building C object CMakeFiles/main.dir/home/lubuntu/pico/pico-sdk/src/rp2_common/pico_stdlib/stdlib.c.obj [ 17%] Building C object CMakeFiles/main.dir/home/lubuntu/pico/pico-sdk/src/rp2_common/hardware_gpio/gpio.c.obj [ 19%] Building C object CMakeFiles/main.dir/usb_descriptors.c.obj [ 20%] Building C object CMakeFiles/main.dir/main.c.obj <command-line>: warning: "CFG_TUSB_DEBUG" redefined <command-line>: warning: "CFG_TUSB_DEBUG" redefined <command-line>: note: this is the location of the previous definition <command-line>: warning: "CFG_TUSB_DEBUG" redefined <command-line>: note: this is the location of the previous definition <command-line>: note: this is the location of the previous definition <command-line>: warning: "CFG_TUSB_DEBUG" redefined <command-line>: note: this is the location of the previous definition /home/lubuntu/pico/Busylight/usb_descriptors.c:94:16: error: conflicting types for 'tud_hid_descriptor_report_cb' 94 | uint8_t const *tud_hid_descriptor_report_cb(void) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /home/lubuntu/pico/pico-sdk/lib/tinyusb/src/tusb.h:68, from /home/lubuntu/pico/Busylight/usb_descriptors.c:26: /home/lubuntu/pico/pico-sdk/lib/tinyusb/src/class/hid/hid_device.h:96:17: note: previous declaration of 'tud_hid_descriptor_report_cb' was here 96 | uint8_t const * tud_hid_descriptor_report_cb(uint8_t instance); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /home/lubuntu/pico/pico-sdk/lib/tinyusb/src/tusb.h:65, from /home/lubuntu/pico/Busylight/usb_descriptors.c:26: /home/lubuntu/pico/Busylight/usb_descriptors.c:116:52: error: 'HID_PROTOCOL_NONE' undeclared here (not in a function); did you mean 'HID_PROTOCOL_BOOT'? 116 | TUD_HID_DESCRIPTOR(ITF_NUM_HID, 0, HID_PROTOCOL_NONE, sizeof(desc_hid_report), EPNUM_HID, | ^~~~~~~~~~~~~~~~~ /home/lubuntu/pico/pico-sdk/lib/tinyusb/src/device/usbd.h:239:69: note: in definition of macro 'TUD_HID_DESCRIPTOR' 239 | 9, TUSB_DESC_INTERFACE, _itfnum, 0, 1, TUSB_CLASS_HID, (uint8_t)((_boot_protocol) ? HID_SUBCLASS_BOOT : 0), _boot_protocol, _stridx,\ | ^~~~~~~~~~~~~~ make[2]: *** [CMakeFiles/main.dir/build.make:76 : CMakeFiles/main.dir/usb_descriptors.c.obj] Erreur 1 make[2]: *** Attente des tâches non terminées.... /home/lubuntu/pico/Busylight/main.c:124:10: error: conflicting types for 'tud_hid_get_report_cb' 124 | uint16_t tud_hid_get_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t *buffer, uint16_t reqlen) { | ^~~~~~~~~~~~~~~~~~~~~ In file included from /home/lubuntu/pico/pico-sdk/lib/tinyusb/src/tusb.h:68, from /home/lubuntu/pico/pico-sdk/lib/tinyusb/hw/bsp/board.h:42, from /home/lubuntu/pico/Busylight/main.c:9: /home/lubuntu/pico/pico-sdk/lib/tinyusb/src/class/hid/hid_device.h:101:10: note: previous declaration of 'tud_hid_get_report_cb' was here 101 | uint16_t tud_hid_get_report_cb(uint8_t instance, uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen); | ^~~~~~~~~~~~~~~~~~~~~ /home/lubuntu/pico/Busylight/main.c:136:6: error: conflicting types for 'tud_hid_set_report_cb' 136 | void tud_hid_set_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t const *buffer, uint16_t bufsize) { | ^~~~~~~~~~~~~~~~~~~~~ In file included from /home/lubuntu/pico/pico-sdk/lib/tinyusb/src/tusb.h:68, from /home/lubuntu/pico/pico-sdk/lib/tinyusb/hw/bsp/board.h:42, from /home/lubuntu/pico/Busylight/main.c:9: /home/lubuntu/pico/pico-sdk/lib/tinyusb/src/class/hid/hid_device.h:105:6: note: previous declaration of 'tud_hid_set_report_cb' was here 105 | void tud_hid_set_report_cb(uint8_t instance, uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize); | ^~~~~~~~~~~~~~~~~~~~~ make[2]: *** [CMakeFiles/main.dir/build.make:63 : CMakeFiles/main.dir/main.c.obj] Erreur 1 make[1]: *** [CMakeFiles/Makefile2:1538 : CMakeFiles/main.dir/all] Erreur 2 make: *** [Makefile:84 : all] Erreur 2

Breakout game for Raspberry Pi Pico with Pimoroni Pico Display pack
Breakout game for Raspberry Pi Pico with Pimoroni Pico Display pack

breakout_rpi_pico Breakout game for Raspberry Pi Pico with Pimoroni Pico Display pack Prebuilt binary (breakout.uf2) is here. To build your own binary

Oct 15, 2022
Pico-uart-bridge - Raspberry Pi Pico UART-USB bridge

Raspberry Pi Pico USB-UART Bridge This program bridges the Raspberry Pi Pico HW UARTs to two independent USB CDC serial devices in order to behave lik

Dec 23, 2022
Digital rain animation gif with glow squeezed into a raspberry pi pico and pimoroni pico-display
Digital rain animation gif with glow squeezed into a raspberry pi pico and pimoroni pico-display

pico-display-matrix Digital rain animation gif with glow squeezed into a raspberry pi pico and pimoroni pico-display or how to actually use all Flash

Sep 10, 2022
Web Server based on the Raspberry Pico using an ESP8266 with AT firmware for WiFi
Web Server based on the Raspberry Pico using an ESP8266 with AT firmware for WiFi

PicoWebServer This program runs on a Raspberry Pico RP2040 to provide a web server when connected to an Espressif ESP8266. This allows the Pico to be

Jan 7, 2023
Flashrom/serprog compatible firmware for the Raspberry Pi Pico

pico-serprog This is a very basic flashrom/serprog compatible SPI flash reader/writer for the Raspberry Pi Pico. It does not require a custom version

Dec 24, 2022
Prueba del Raspberry PI PICO con un display Raspberry PI TFT 3.5"

Raspberry-PI-PICO-display-RPI35 Prueba del Raspberry PI PICO con un display Raspberry PI TFT 3.5" Con ayuda de la libreria https://github.com/khoih-pr

Nov 10, 2021
A fork of Picoprobe, an SWD progammer firmware, for the Pico Debug'n'Dump

pdnd-picoprobe A fork of Picoprobe, an SWD progammer firmware, for the Pico Debug'n'Dump. Usage Make sure the "Mode" switch is set to I2C/SWD Follow g

Nov 4, 2022
RPi Pico/RP2040 firmware for the Scoppy Oscilloscope

scoppy-pico RPi Pico/RP2040 firmware for the Scoppy Oscilloscope Installation and getting started instructions Scoppy Android app - Play Store Scoppy

Dec 20, 2022
Raspberry Pi Pico (RP2040) and Micro-ROS (ROS 2) Integration

The Pico is an amazing microcontroller and I couldn't wait for ROS 2 support or Arduino Core, so here is my approach. Once the Arduino Core for RP2040 is out it will be easier to use micro_ros_arduino.

Jun 19, 2022
built-in CMSIS-DAP debugger tailored especially for the RP2040 “Raspberry Pi Pico”

RP2040 has two ARM Cortex-M0+ cores, and the second core normally remains dormant. pico-debug runs on one core in a RP2040 and provides a USB CMSIS-DAP interface to debug the other core. No hardware is added; it is as if there were a virtual debug pod built-in.

Dec 30, 2022