Category Archives: raspberryPi

How to Run Arduino Code & Programs on Raspberry Pi

Raspberry Pi is an amazing minicomputer, and I would love to use it in some projects. There is just one tiny problem. I have little to no experience with Python. I used to do some Python coding a few years ago but only the basics. I’m more experienced in C++, specifically writing programs for Arduino. Wouldn’t it be nice if there was some way for those of us to utilize our Arduino programming skills on Raspberry Pi? Luckily, there is!

In this article, you will learn how to run sketches written for Arduino on Raspberry Pi! To achieve this, we will use RasPiArduino framework. That will allow us to compile the Arduino code into binaries which can run on Raspberry Pi. But before we can do that, we have to prepare a few things, both in the Arduino IDE and on Raspberry Pi.

Hardware

  • Raspberry Pi 3 Model B

Software

Source: How to Run Arduino Code & Programs on Raspberry Pi

How to Connect to the Serial Port on a Raspberry Pi using a USB Adapter or TTL Converter – Practicing Electronics

Using an RS232-to-TTL converter

An RS232-to-TTL converter converts RS232 voltage levels to TTL levels that can be used by the Pi (and vice versa).  I use NulSom’s Ultra Compact RS232 to TTL Converter with Male DB9.  This converter fits within a DB9 back shell.

serial-1.png

The converter has solder terminals that I connected to female header adapters, and connected to pins 4, 6, 8, and 10 on the Pi.

serial-3.png

The setup is more compact compared to using a USB adapter.

serial-2.png

In the Pi, the serial port might need to be enabled in the configuration settings.

My serial port shows up in the /dev folder as ttyS0.

Source: How to Connect to the Serial Port on a Raspberry Pi using a USB Adapter or TTL Converter – Practicing Electronics