「GR0-3350 I2C電圧変換」を使います。
プログラム
grove-lcd.ino
// ---------------------------------------------------------------
// grove-lcd.ino
//
// Aug/30/2024
// ---------------------------------------------------------------
#include <WioLTEforArduino.h>
#include <Wire.h>
#include "rgb_lcd.h"
WioLTE Wio;
rgb_lcd lcd;
const int colorR = 255;
const int colorG = 255;
const int colorB = 0;
// ---------------------------------------------------------------
void setup() {
SerialUSB.println("### I/O Initialize.");
Wio.Init();
SerialUSB.println("### Power supply ON.");
Wio.PowerSupplyGrove(true);
delay(500);
Wire.begin();
delay(500);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
delay(500);
lcd.setRGB(colorR, colorG, colorB);
lcd.setCursor(0, 0);
lcd.print(" ");
delay(500);
// Print a message to the LCD.
lcd.setCursor(0, 0);
lcd.print("Good, Morning!");
delay(500);
}
// ---------------------------------------------------------------
void loop() {
int it = millis()/ 1000;
lcd.setCursor(0, 1);
lcd.print(it);
SerialUSB.printf("LED Sample %d\n",it);
lcd.setCursor(0, 0);
lcd.print("Good, Afternoon!");
delay(3000);
}
// ---------------------------------------------------------------