Arduino VS CircuitPython Speed Comparison I run the same Pi approximation algorithm on two Raspberry Pi Pico Boards. One board is using CircuitPython and the other one is using Arduino. Which one is faster, and by how much? Let's find out. CircuitPython Code: 🤍github.com/educ8s/CircuitPython-Pi-Calculation-Benchmark Arduino Code: 🤍github.com/educ8s/Arduino-Pi-Calculation-Benchmark Join this channel to get access to perks: 🤍🤍youtube.com/channel/UCxqx59koIGfGRRGeEm5qzjQ/join
How can I now if you add sleep code in Micropython to make it slower...
I'm kidding, good video!
100% useful very very
I can tell you that if you know python and don't know c++, python will be easier
me having always used C/C++ it's a no brainer over learning python
a nice comparison to demostrate the speed difference. :)
I downloaded the code to see if it could help identify the issues I have at the moment with the Pico and St7735 under Arduino v2.1.0 IDE but the code compilation produces the following errors:
...\AppData\Local\Temp\.arduinoIDE-unsaved2023612-2584-heek7s.8rgmq\sketch_jul12a\sketch_jul12a.ino: In function 'void drawResults(double, double)':
...\AppData\Local\Temp\.arduinoIDE-unsaved2023612-2584-heek7s.8rgmq\sketch_jul12a\sketch_jul12a.ino:93:3: error: 'dtostrf' was not declared in this scope
dtostrf(pi, 7, 5, result);
^~~~~~~
...\AppData\Local\Temp\.arduinoIDE-unsaved2023612-2584-heek7s.8rgmq\sketch_jul12a\sketch_jul12a.ino:93:3: note: suggested alternative: 'strstr'
dtostrf(pi, 7, 5, result);
^~~~~~~
strstr
exit status 1
Compilation error: 'dtostrf' was not declared in this scope
##########
What version libraries (GFX, ST7735, and SPI) are you using?
Have you had a problem with the Pico and the ST7735 screen when writing text? My code (snippet below) displays properly until the '.print' is uncommented. It then makes the screen flash rapidly or go completely white.
// Load the Libraries
youtube.com/results?search_query=%23include #include <Adafruit_GFX.h> // Adafruit LCD Graphics library
youtube.com/results?search_query=%23include #include <Adafruit_ST7735.h> // ST7735 LCD Display library
youtube.com/results?search_query=%23include #include <SPI.h> // Arduino SPI and I2C library
/************************ DISPLAY CONFIG **************************/
// pin definition for the 1.8", 128x160 ST7735 LCD Display on Raspberry Pico
// These can be connected to any GP Pin not in use
youtube.com/results?search_query=%23define #define TFT_CS 9 // using SPI1 CSn
youtube.com/results?search_query=%23define #define TFT_RST 8
youtube.com/results?search_query=%23define #define TFT_DC 7
// Used for SPI connectivity on SPI1
youtube.com/results?search_query=%23define #define TFT_SCK 10
youtube.com/results?search_query=%23define #define TFT_MOSI 11
// Setup the ST7735 LCD Display and variables
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCK, TFT_RST);
int textxoffset = 5; // move 5 pixels across to avoid the box
int textyoffset = 7; // move 7 pixels down to avoid the box
int tft_line1 = 0;
/*******************************************************************/
/************************ SENSOR CONFIG **************************/
/********************************************************************/
/********************** INTERRUPT FUNCTION ************************/
/********************************************************************/
/********************* TEMP SENSOR READ CODE **********************/
/********************************************************************/
/************************* SETUP CONFIG ***************************/
/********************************************************************/
void setup() {
/********************** SERIAL Output SETUP ************************/
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.println("Initialising SD card...");
/********************************************************************/
/********************** Initial LCD SETUP ************************/
// Initialise the 1.8" LCD Screen
tft.initR(INITR_BLACKTAB); // initialize a ST7735S chip, black tab
tft.fillScreen(ST7735_BLACK); // Fill the screen with Black
tft.setRotation(1); // Set rotation to Portrait mode (set to '1' for Landscape)
tft.setTextWrap(false); // By default long lines of text are NOT wrapped at the end of the line, set to 'TRUE' for wrapping the text
// Draw the 1.8" LED display layout
tft.drawRoundRect(0, 0, 83, 31, 10, ST7735_CYAN); // Draw a Rectangle x,y, across, down with corner & Colour Values
tft.drawRoundRect(0, 35, 160, 93, 10, ST7735_CYAN); // Draw a Rectangle x,y, across, down with corner & Colour Values
tft.drawLine(80, 65, 80, 110, ST7735_CYAN); // Draw a mid-line x1,y1, x2, y2 for the Colour Values
tft.setTextColor(ST7735_GREEN, ST7735_BLACK);
tft.setTextSize(1); // Set the text size to 1
tft.setCursor(textxoffset + 54,textyoffset + 1);
// tft.print("Test"); // ENABLE THIS LINE AND THE LCD STARTS FLASHING RAPIDLY OR GOES WHITE
// THE CODE CONTINUES CORRECTLY IN THE BACKGROUND THOUGH
/********************************************************************/
Serial.println("STARTING TEMP READINGS");
}
void loop() {
}
qym-P4GTdIU&t=2m51s 2:51 Why is it easier? Personally I find the weird object-everything approach (minion3.display.colour.change.red) with crazy user chosen names and the indentation police of python tougher than c++.
Can you compare both too on energy use, also including examples that need a Pico to run in Python, but would fit compiled on an Attiny85. How do those situations compare in speed and energy use?
This is very interesting information. Do you have some kind of examples using the Debian-Bullseye Orange Pi-5 GPIO PWM servo pins? Thank you.
Great video Nick
Why do people call "Arduino" a language, instead of a set of libraries...? I find the terminology confusing.
arduino nano is 8 times slower than pico but if you use python it would be only like 2.6times unless using the second core. however with complex libraries my code ran like 10x slower than arduino nano. so I’ll have to start all over with arduino c
Another problem is often you install libraries that come as packages with many things you don’t even need that take up so much space you run out of flash memory so you then spend a lot of time looking for smaller packages or single library files
Интересно
This is because you helped on the Seeeduino XIAO
are you greek?
απο τον τίτλο φαντάστηκα το αποτέλεσμα χδ
One area of concern for me is program security. If I am going to make and sell a widget using an RPi Pico, I don't want someone to be able to duplicate it by stealing my code from one of my widgets. With Circuit Python the can easily open the memory storage and copy my code from the RPi. With Arduino code only the compiled code is place on the widget and it is much more difficult to reverse-engineer.
On other hand, at work, when I make a device to be used in the lab, if I want anyone to be able to edit the code I put there, then Circuit Python is the way to go.
Great test.
Great video as always 👍😃
! At last :) thank you
How can I use c++ language on pico please help me
Is it possible to write a program in an interpreted language and convert it to binary prior to flashing it to a micro controller to avoid interpreting it again every time it is run? As to previous comments: No REPL but over the air updates might just require converting to binary or compiling again prior to updating. Aren't OTA updates possible using compiled Arduino code?
Another advantage for boards that use an interpreter, if the board also has Bluetooth or wi-fi, you can update the code remotely, because you are just replacing a file.