跳到主要内容

Using the Grove Analog Port on Wio Terminal

This repo demonstrates how to use Analog as inputs on Wio Terminal. To use analog pins on Wio Terminal, you must use RPI pins.

RPI Analog Pins​

The Raspberry Pi pinouts are defined as:

  • RPI_A0 -> RPI_A8

Grove Port Configurations​

To use the Grove configurable A/D Port as Analog port, simply define it as follow:

void setup() {
pinMode(A0, INPUT);
}

Now, connect your Grove sensor to the physical pin!

Example Code​

In this example, a Grove Loudness sensor is used to demonstrate:

void setup() {
Serial.begin(115200);
pinMode(A0, INPUT);
}
void loop() {
int loudness = analogRead(A0);
Serial.print("Loudness: ");
Serial.println(loudness);
delay(50);
}

Tech Support​

if you have any technical issue. submit the issue into our forum.


Loading Comments...