In the first part, I tested out Python to see if it was possible to gather some system information which worked very well. While waiting for the LCD screen to arrive I thought I'd try to see how straight forward it was to get that information out of a serial port.
I connected some hookup wires to the internal serial port of my Desktop PC:
And then used the following Python script to test:
#!/usr/bin/env python import unittest import sys import serial PORT = '/dev/ttyS0' BAUDRATE = 115200 sport = serial.serial_for_url(PORT, BAUDRATE, timeout=10) sport.write("hello") sport.close()
Just a very short script to open the port, send out the word "hello" and then close the port again. So I connected an oscilloscope to the hookup wires to monitor whether any signals were being sent when the script runs:
Awesome, the script works, the serial port works and there is a definite path to transfer system information to an Arduino which then display that onto and external LCD.
I was hoping to get some back and forth communication between the Python script and the Arduino happening but the oscilloscope suddenly reminded me of something I'd completely overlooked, it's been so long since working with serial ports that I'd forgotten that the desktop pc uses +/- 12V on its serial port and the Arduino uses 0V/5V ttl serial. Damn... I need order a level shifter before I can move onto that stage