More than 3 years have passed since last update.
Grove IoT スターターキット for SORACOM の使い方
1
Last updated at Posted at 2021-08-04
「Grove IoT スターターキット for SORACOM」の最初の使い方として、基盤についている LED を点灯させてみました。
led_test/led_test.ino
// ---------------------------------------------------------------
/*
led_test.ino
Aug/04/2021
*/
// ---------------------------------------------------------------
# include <WioLTEforArduino.h>
WioLTE Wio;
void setup() {
delay(1000);
SerialUSB.println("");
SerialUSB.println("*** START ***");
SerialUSB.println("### I/O Initialize.");
Wio.Init();
delay(1000);
SerialUSB.println("### Setup completed.");
SerialUSB.println("");
}
// ---------------------------------------------------------------
void loop() {
led_delay_proc(0,0,1,1000,"blue");
led_delay_proc(0,1,0,1000,"lime");
led_delay_proc(1,0,0,1000,"red");
led_delay_proc(1,1,0,1000,"yellow");
led_delay_proc(0,1,1,1000,"cyan");
led_delay_proc(0,0,0,2000,"black");
SerialUSB.println("");
}
// ---------------------------------------------------------------
void led_delay_proc(int rr,int gg,int bb,int msec,String mesg){
Wio.LedSetRGB(rr, gg, bb);
SerialUSB.println("*** "+ mesg + " ***");
delay(msec);
}
// ---------------------------------------------------------------
Arduino IDE の様子
👁 arduino_ide_aa.png
マイコンボードに書き込んで、実行させます。
LED が点灯し、シリアルモニタに次の表示が出ます。
👁 wiolte_aa.png
実行時の様子
👁 wiolte_aa.jpg
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
