Example Code for Arduino UNO-All Sensor Data

Retrieve all sensor data from the specified port in a formatted string. Users can learn how to get comprehensive sensor data for parsing and table generation.

Hardware Preparation

Software Preparation

Wiring Diagram

Other Preparation Work

  • Ensure the SCI DAQ module is properly connected to the Arduino UNO via the Gravity IO Expansion Shield.
  • Install the required library in Arduino IDE.

Sample Code

#include "DFRobot_RP2040_SCI.h"

DFRobot_RP2040_SCI_IIC sci(/*addr=*/RP2040_SCI_ADDR_0X21, &Wire);

void setup() {
  Serial.begin(115200);
  while(!Serial){                                                     //Waiting for USB Serial COM port to open.
  }

  Serial.print("Initialization SCI DAQ Module...");
  while(sci.begin() != 0){
      Serial.println("failed. Please check whether the hardware connection is wrong.");
      delay(1000);
      Serial.print("Initialization SCI DAQ Module...");
  }
  Serial.println("done.");
}

void loop() {
  String ifAll = sci.getInformation(sci.eALL, true);
  Serial.println(ifAll);
  Serial.println();
  delay(1000);
}

Result

Result

Additional Information

  • The output format is "Name 1: Value 1 Unit 1, Name 2: Value 2 Unit 2".

Was this article helpful?

TOP