Example Code for Arduino-Read Data
Last revision 2025/12/19
The blog post offers a detailed guide on utilizing Arduino to read data from sensors. It includes hardware and software preparation, a wiring diagram, and example code to print analog sensor values through the serial port, using components like the DFRduino UNO R3 and ADKey Board.
Hardware Preparation
- DFR0216-2 DFRduino UNO R3 with IO Expansion Shield and USB Cable A-B x 1
- DFR0792 Fermion: ADKey Board x1
- FIT0916-FF DuPont Wires x3
Software Preparation
- Download Arduino IDE: Click to download Arduino IDE
Wiring Diagram

Sample Code
#define ADPIN A0 //Read Pin
void setup() {
Serial.begin(115200);
}
void loop() {
// read the value from the sensor:
Serial.println(analogRead(ADPIN));
delay(10);
}
Result
Print the analog output value through the serial port.

Was this article helpful?
