Blink

Overview

Turns on and off the LEDs on the AVR MCU leaf every second.

Leaf to use

Use the following leaves.

Type Name Q’ty
AZ62 Connector Cover 1
AZ01 USB 1
AP01 AVR MCU 1
AV01 CR2032 1
CR2032 coin cell battery 1
M2*10mm screw 2

Assembly

Let’s assemble leaves as shown in the figure below.

assemble1

Source code

Write the following program in the Arduino IDE.

//=====================================================================
//  Blink
//
//    (c) 2020 Trillion-Node Study Group
//    Released under the MIT license
//    https://opensource.org/licenses/MIT
//
//      Rev.00 2020/05/05  First release
//=====================================================================

void setup() {
  // LEDピンを出力ピンに設定
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // LEDを点灯
  delay(1000);                       // 1秒待つ
  digitalWrite(LED_BUILTIN, LOW);    // LEDを消灯
  delay(1000);                       // 1秒待つ
}

Blink.ino

Execution Results

The LED on the AVR MCU leaf turns on and off every 1 second.


Last modified 07.12.2020