{"id":23891628,"url":"https://github.com/stephendade/mav_rp2040","last_synced_at":"2025-04-10T11:23:52.878Z","repository":{"id":148321062,"uuid":"565337664","full_name":"stephendade/mav_rp2040","owner":"stephendade","description":"MAVLink for the RP2040","archived":false,"fork":false,"pushed_at":"2024-05-22T11:01:45.000Z","size":1382,"stargazers_count":25,"open_issues_count":2,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-24T10:11:15.299Z","etag":null,"topics":["ardupilot","mavlink","micropython","raspberry-pi-pico","rp2040"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stephendade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-13T04:08:42.000Z","updated_at":"2025-03-05T22:33:44.000Z","dependencies_parsed_at":"2023-05-19T18:30:41.011Z","dependency_job_id":null,"html_url":"https://github.com/stephendade/mav_rp2040","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephendade%2Fmav_rp2040","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephendade%2Fmav_rp2040/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephendade%2Fmav_rp2040/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephendade%2Fmav_rp2040/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephendade","download_url":"https://codeload.github.com/stephendade/mav_rp2040/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248208612,"owners_count":21065203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ardupilot","mavlink","micropython","raspberry-pi-pico","rp2040"],"created_at":"2025-01-04T13:00:22.706Z","updated_at":"2025-04-10T11:23:52.861Z","avatar_url":"https://github.com/stephendade.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MAVLink Sensor for the RP2040\n\nThis repository contains code for automatically sending analogue sensed values from a RP2040-based board (such as a Raspberry Pi Pico board) to a flight controller via MAVLink.\n\nThis allows the sensed values to appear in the GCS.\n\nExamples are given in both Python and C.\n\n## Hardware setup\n\n### Setup:\n1. Connect the RP2040 to a spare UART on the flight controller. Only the +5V, RX, TX and GND lines need to be connected\n2. Connect any desired sensors to the A0, A1, A2 and A3 ports on the RP2040\n3. Ensure the UART on the flight controller is set to MAVLink2, 57600 baud\n\n## C\n\nThe [Raspberry Pi Pico SDK](https://www.raspberrypi.com/documentation/microcontrollers/c_sdk.html) is required to be installed.\n\nNOTE: ArduPilot and the RP2040 require different versions of the arm-gcc compiler. Please be careful about which compiler is on the system path. THe RP2040 will typically use the compiler at ``/usr/bin``, whilst ArduPilot will typically use the compiler at ``/opt/gcc-arm-none-eabi-10-2020-q4-major/bin``\n\nUse to following commands to build the program:\n```\nmkdir ./c/build\ncd ./c/build\ncmake .. -DPICO_BOARD=pico -DPICO_TOOLCHAIN_PATH=/usr/bin/\nmake\n```\n\nThen copy the ``./c/build/mavlink_periph.uf2`` file to the RP2040.\n\n## Python\nThe [Micropython](https://micropython.org/) framework is required to be installed on the RP2040, in order to run the code.\n\nUse the ``upload.py`` script to upload the code to the RP2040.\n\n## Running\nThe code will automatically run on boot, flashing a LED each time a MAVLink heartbeat packet is received.\n\nThe RP2040 will send readings from the analogue ports A0, A1, A2 and A3 at 1 second intervals. The readings are in volts.\n\nThe readings can be viewed at a GCS, such as Mission Planner or MAVProxy.\n\nIn MAVProxy, use the following command:\n```\ngraph NAMED_VALUE_FLOAT[ADC0].value NAMED_VALUE_FLOAT[ADC1].value NAMED_VALUE_FLOAT[ADC2].value NAMED_VALUE_FLOAT[ADC3].value\n```\n\nIn Mission Planner, select the \"peripheral\" component, then right click in the \"quick\" tab and select the ADC value to display:\n![](missionplanner.png)\n\n\n### Developers\nDue to resource constraints in Micropython, a limited MAVLink interpreter is included (``pymavminimal.py`` and ``mavcrc.py``). Message\nsigning is not available. See ``main.py`` for a basic example of sending and receiving MAVLink messages.\n\nThe follow messages are supported:\n\n```\nAHRS (163)\nDATA16 (169)\nDATA32 (170)\nDATA64 (171)\nDATA96 (172)\nHEARTBEAT (0)\nSYS_STATUS (1)\nSYSTEM_TIME (2)\nGPS_RAW_INT (24)\nATTITUDE (30)\nVFR_HUD (74)\nCOMMAND_INT (75)\nCOMMAND_LONG (76)\nCOMMAND_ACK (77)\nNAMED_VALUE_FLOAT (251)\nNAMED_VALUE_INT (252)\nSTATUSTEXT (253)\nSCALED_IMU (26)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephendade%2Fmav_rp2040","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephendade%2Fmav_rp2040","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephendade%2Fmav_rp2040/lists"}