Skip to content
/ PiCAN Public

A functionality test with the RP2040 chip and CAN2040 library.

Notifications You must be signed in to change notification settings

moeux/PiCAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PiCAN

Welcome to the PiCAN project! This repository showcases the capabilities of the RP2040 microchip in combination with CAN bus technology.

Overview

PiCAN demonstrates how to use the Raspberry Pi Pico with CAN bus communication to transfer data between devices. The project is divided into two main branches:

  • main: A simple CAN bus message transfer example.
  • add-joystick-servo-controls: An advanced example where a joystick controls a servo via CAN bus.

Branches

The main branch contains a straightforward example of CAN bus message transfer. In this example:

  1. One Raspberry Pi Pico receives input through the Serial Monitor.
  2. This input is then transmitted over the CAN bus.
  3. Another Raspberry Pi Pico receives the CAN bus message and outputs it through its Serial Monitor.

can-msg-transfer

The add-joystick-servo-controls branch extends the functionality by allowing a servo to be controlled with a joystick. The setup is as follows:

  1. A Raspberry Pi Pico with a joystick attached sends the joystick values over the CAN bus.
  2. Another Raspberry Pi Pico with a servo attached receives the joystick values.
  3. The receiving Pico sets the angle of the servo based on the joystick input.

joystick-servo-control

Hardware

Libraries

Special thanks to the authors of these libraries.

Getting Started

Installation

  1. Clone the repository:

    git clone https://github.com/moeux/PiCAN.git
    cd PiCAN
  2. Switch to the desired branch:

    For the basic CAN bus message transfer:

    git checkout main

    For the joystick to servo control example:

    git checkout add-joystick-servo-controls
  3. Upload the code to your Raspberry Pi Pico boards:

    Use your preferred method to upload the code to the Raspberry Pi Pico boards.
    I recommend flashing the code onto the Raspberry Pi Pico using the Raspberry Pi Pico VSCode Extension.
    For further setup instructions refer to the Getting Started Guide by Raspberry Pi.

Enjoy exploring the possibilities of RP2040 and CAN bus technology with PiCAN!

About

A functionality test with the RP2040 chip and CAN2040 library.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published