In this Raspberry pi serial reading and writing tutorial, we will be showing you how to read and write data through the serial GPIO connections that are made available to you on your Raspberry Pi.
We will be showing you how to do these serial writes by using a RS232 to TTL Adapter to create a loop back to the Raspberry Pi, the same concept will work with any serial device.
You will be learning what GPIO pins you need to utilize to be able to wire up to your serial device to the Raspberry Pi, we will also be showing the steps you must go through to allow the Raspberry Pi to read and write through the TX and RX GPIO pins.
We will also be teaching you how you would read and write data through the serial ports using the Python programming language, this should give you a good idea how you would deal with normal serial devices and not just a loopback to the Raspberry Pi.
Each Friday is PiDay here at Adafruit! Be sure to check out our posts, tutorials and new Raspberry Pi related products. Adafruit has the largest and best selection of Raspberry Pi accessories and all the code & tutorials to get you up and running in no time!
Make a robot friend with Adafruit’s CRICKIT – A Creative Robotics & Interactive Construction Kit. It’s an add-on to our popular Circuit Playground Express, FEATHER and other platforms to make and program robots with CircuitPython, MakeCode, and Arduino. Start controlling motors, servos, solenoids. You also get signal pins, capacitive touch sensors, a NeoPixel driver and amplified speaker output. It complements & extends your boards so you can still use all the goodies on the microcontroller, now you have a robotics playground as well.