The Adafruit Metro RP2040 takes the Arduino format and adds the Raspberry Pi RP2040.
In addition to the normal UNO I/O, there is a micro-SD socket and Stemma QT socket.
Showing posts with label Arduino. Show all posts
Showing posts with label Arduino. Show all posts
Sunday, 24 December 2023
Sunday, 5 July 2020
Reading USB (Serial) data
Most microcontrollers have an option to output data over the USB link.
It is helpful during development to be able to read state information and other values that allow the developer to see what is happening.
The first thing is to identify which USB port is in use.
It is helpful during development to be able to read state information and other values that allow the developer to see what is happening.
The first thing is to identify which USB port is in use.
foreach (string port in ports)
{
Console.WriteLine(port);
}
For my set up, COM5 was the one in use.
using (var sp = new System.IO.Ports.SerialPort("COM5", 115200, System.IO.Ports.Parity.None, 8, System.IO.Ports.StopBits.One))
{
Console.WriteLine("Reading serial port");
sp.Open();
while (true)
{
var readData = sp.ReadLine();
Console.WriteLine($"[{readData}]");
}
}
This will display on the console anything output from the device.
Thursday, 12 July 2018
Plotting temperature over time on a Raspberry Pi
A while back I assembled a temperature measuring system using a DS18B20 temperature sensor which was read by an Arduino fitted with an Ethernet Shield.
To record the temperature over time, I wrote a simple Python program running on a Raspberry Pi 3 to access the Arduino over my local network.
It was not the most elegant of programs, but it recorded the time and temperature into a CSV file.
The CSV file was then opened in Libre Calc, and the results plotted out.
To record the temperature over time, I wrote a simple Python program running on a Raspberry Pi 3 to access the Arduino over my local network.
It was not the most elegant of programs, but it recorded the time and temperature into a CSV file.
The CSV file was then opened in Libre Calc, and the results plotted out.
Tuesday, 3 July 2018
The Sketch That Does Nothing
One of the joys of playing with Arduinos is putting something together, and then taking it apart and building something else.
The various shields sometimes make use of the same pins, and the result of using the previous sketch might be unpredictable.
This sketch literally does nothing, except tell you it does nothing over the serial link.
The various shields sometimes make use of the same pins, and the result of using the previous sketch might be unpredictable.
This sketch literally does nothing, except tell you it does nothing over the serial link.
void setup() { // Technology Is Not Dull 2018 // Use this project to clear sketch from Arduino Board // before fitting a shield so the starting sketch does not // cause any issues with the newly fitted shield. Serial.begin(9600); Serial.println("Starting The Project That Does Nothing!"); Serial.println("Closing Serial port"); Serial.end(); } void loop() { // Nothing to see, move along... }
Sunday, 1 July 2018
GPS Stack - physical build
So this project is to build a simple GPS locator using an Arduino compatible controller, a LinkSprite GPS Shield and a LinkSprite LCD shield.
The specification for the Arduino allows the stacking of shields. What you do need to ensure is that there are no conflicts over pins.
The controller is the Ciseco Xino RF board.
There is nothing overly important about using this rather than an Arduino UNO, except this board uses a mini USB socket for power so the DC in socket is the highest point.
The GPS shield fits on top. Aligning the pins is a bit worrying as they are a bit delicate and the LinkSprite assembly is a bit squint.
The topping on the stack is the LCD shield.
The alignment issues are clear on the sockets on the photograph above.
Here is the assembled stack.
The DC in socket contacts the
The specification for the Arduino allows the stacking of shields. What you do need to ensure is that there are no conflicts over pins.
There is nothing overly important about using this rather than an Arduino UNO, except this board uses a mini USB socket for power so the DC in socket is the highest point.
The GPS shield fits on top. Aligning the pins is a bit worrying as they are a bit delicate and the LinkSprite assembly is a bit squint.
The topping on the stack is the LCD shield.
The alignment issues are clear on the sockets on the photograph above.
Here is the assembled stack.
The DC in socket contacts the
LinkSprite GPS Shield
The LinkSprite GPS shield provides GPS data for Arduino and compatible microcontrollers.
Another purchase from Maplin, this has not particularly good instructions. The photograph on the instructions page is unclear as to how to set up the shorting pins to select the serial port.
The shield takes an SD card, note that due to its advanced age, it only takes SD cards - not SDHC and above. It is a bit difficult to find 2GB cards.
Another purchase from Maplin, this has not particularly good instructions. The photograph on the instructions page is unclear as to how to set up the shorting pins to select the serial port.
The shield takes an SD card, note that due to its advanced age, it only takes SD cards - not SDHC and above. It is a bit difficult to find 2GB cards.
References:
http://linksprite.com/wiki/index.php5?title=GPS_Shield_With_SD_Card_Slot_for_Arduino_V2.0_BCiseco Xino RF microcontroller
The Ciseco Xino RF is an Arduino Uno compatible microcontroller with a built in radio module.
Maplins stocked the Raspberry Wireless Inventor Kit for the the original Raspberry Pi. It included a Xino RF micro and a matching radio card for the 26 pin connector on the original Raspberry Pi. There was a set in the Maplins closing down sale which was about the same price as an Arduino Uno (but with added LEDs etc) so I added it to my collection (I bought one with my original Model B).
The Xino RF can be used as an Arduino with the added advantage that it uses a Mini USB for power (the DC in port is the highest point on the board, unlike on the UNOs where the USB-A connector with a metal case is the highest point. There is a sketch available that will return it to the Wireless Inventors mode.
![]() |
| Add caption |
The Xino RF can be used as an Arduino with the added advantage that it uses a Mini USB for power (the DC in port is the highest point on the board, unlike on the UNOs where the USB-A connector with a metal case is the highest point. There is a sketch available that will return it to the Wireless Inventors mode.
LinkSprite LCD Arduino Shield
The LinkSprite 16x2 LCD Shield is a display shield for Arduino compatible microcontrollers.
Maplins (late supplier of electronic bits) stocked a range of LinkSprite products. One of many problems was they had a lot of rather ancient stuff that sat on shelves and was more of interest to archaeologists. With the loss of Maplins, it can be difficult to identify the particular items, but LinkSprite does still have a products wiki here.
Do be aware that the pins used by this LCD shield do not match those on the Arduino examples sketches. To make it more confusing, the example code on the LinkSprite site works (by setting the values in the initialization call) but has not had the pin selection changed in the comments.
If you use the Arduino LCD Shield "HelloWorld" example code, you need to change the pins used :
//const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
const int rs = 8, en = 9, d4 = 4, d5 = 5, d6 = 6, d7 = 7;
Ensure that the pins are not in use by any other shields or added hardware.
http://linksprite.com/wiki/index.php5?title=16_X_2_LCD_Keypad_Shield_for_Arduino_V2
https://www.arduino.cc/en/Tutorial/HelloWorld
Maplins (late supplier of electronic bits) stocked a range of LinkSprite products. One of many problems was they had a lot of rather ancient stuff that sat on shelves and was more of interest to archaeologists. With the loss of Maplins, it can be difficult to identify the particular items, but LinkSprite does still have a products wiki here.
Do be aware that the pins used by this LCD shield do not match those on the Arduino examples sketches. To make it more confusing, the example code on the LinkSprite site works (by setting the values in the initialization call) but has not had the pin selection changed in the comments.
If you use the Arduino LCD Shield "HelloWorld" example code, you need to change the pins used :
- LCD RS pin to digital pin 8
- LCD Enable pin to digital pin 9
- LCD D4 pin to digital pin 4
- LCD D5 pin to digital pin 5
- LCD D6 pin to digital pin 6
- LCD D7 pin to digital pin 7
- Wiper to LCD VO pin (pin 3)
//const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
const int rs = 8, en = 9, d4 = 4, d5 = 5, d6 = 6, d7 = 7;
Ensure that the pins are not in use by any other shields or added hardware.
References:
https://www.arduino.cc/en/Reference/LiquidCrystalhttp://linksprite.com/wiki/index.php5?title=16_X_2_LCD_Keypad_Shield_for_Arduino_V2
https://www.arduino.cc/en/Tutorial/HelloWorld
Arduino Installation on the Raspberry Pi
Though most software is available on the Raspberry Pi through the use of the APT repository, for some reason the version of the Arduino IDE is rather old, and possibly non standard.
To obtain the latest version you need to grab it from the Arduino web site here.
Follow the instructions and remember to choose the com port.
To obtain the latest version you need to grab it from the Arduino web site here.
Follow the instructions and remember to choose the com port.
Subscribe to:
Posts (Atom)








