First of all, very good job! I was looking into the web to find a compatibility layer to use arduino-libraries (far more popular than pi) on the CM4 module.
Let me explain the underlying idea I tried to setup based on your repo:
a) I mostly work with ROS2 in advanced robotics applications, where processes are normally multi-thread and heavily network based;
b) the arduino libraries are very popular, and it will be time-efficient to import some of them into raspberry pi C++ code;
now, you enter into the point (b - hopefully), but in order to use the basic arduino functionality (that is heavily used by sensor libraries, for example SPI, I2C etc...), I need to separate the library part from the runnable part, which is the main function using setup/loop classical arduino scheme.
This is what I did:
Built a standalone library including the following files (Qt-like syntax)
Then I also built a secondary library to handle Arduino-like Runner (main function) in order to use the existing libraries (such as SPI, Wire etc.. also without the regular setup/loop scheme)
Then I got the standard blink file and i modified it, replacing the definition for the standard led with:
#include <Arduino.h>
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(PWM00, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(PWM00, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(PWM00, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
I linked the blink file with the two libraries.
Everything compiles fines (although there are a large number of warning - i am allergic to warnings), but unfortunately, this is what I got after run:
UNKNOWN_REVISION: 0x00D03140, MODEL: 0xFFFFFFFF
Are you planning to support CM4, and if so when? Do you need help for testing on such a platform?
Hi!
First of all, very good job! I was looking into the web to find a compatibility layer to use arduino-libraries (far more popular than pi) on the CM4 module.
Let me explain the underlying idea I tried to setup based on your repo:
a) I mostly work with ROS2 in advanced robotics applications, where processes are normally multi-thread and heavily network based; b) the arduino libraries are very popular, and it will be time-efficient to import some of them into raspberry pi C++ code;
now, you enter into the point (b - hopefully), but in order to use the basic arduino functionality (that is heavily used by sensor libraries, for example SPI, I2C etc...), I need to separate the library part from the runnable part, which is the main function using setup/loop classical arduino scheme.
This is what I did:
Then I also built a secondary library to handle Arduino-like Runner (main function) in order to use the existing libraries (such as SPI, Wire etc.. also without the regular setup/loop scheme)
Then I got the standard blink file and i modified it, replacing the definition for the standard led with:
I linked the blink file with the two libraries.
Everything compiles fines (although there are a large number of warning - i am allergic to warnings), but unfortunately, this is what I got after run:
UNKNOWN_REVISION: 0x00D03140, MODEL: 0xFFFFFFFF
Are you planning to support CM4, and if so when? Do you need help for testing on such a platform?