Using the Grove Beginner Kit for Arduino with CodeCraft to make an LED flash. Includes how-to “blocky-program” the code using CodeCraft.


The Grove Beginner Kit For Arduino includes an Arduino Uno board with preconnected devices. The Grove lessons supporting this present coding using the Arduino IDE. These pages present the same lessons using the Codecraft IDE that uses the Block style of coding with specific Grove Arduino blocks.

About

Introduction to using CodeCraft to program an Arduino device. Make an LED flash.

An LED is a Light Emitting Diode. It glows when turned on. The D4 pin on the microprocessor is connected to the LED. This lesson turns D4 repeatdly on and off making the LED flash.
The D in D4 means its a digital pin so it can either be on or off, like a switch. It outputs to the LED so is a Digital Output.

Grove Beginners Kit

The board Lesson 1

Components this lesson
  1. Grove LED

Component Interface Type Pins or Address
LED Digital output D4
Buzzer Digital output D5
OLEDDisplay0.96" I2C display I2C 0x78(default)
Button Digital input D6
RotaryPotentiometer Analog input A0
Light Analog sensor A6
Sound Analog sensor A2
Temperature&HumiditySensor DHT22 Digital sensor D3
AirPressureSensor BMP280 I2C sensor I2C 0x77(default)/0x76(optional)
3-AxisAccelerometer I2C sensor I2C 0x19(default)

Hardware connection

For these lessons, the Components are already connected through the board. That is, for this lesson, LED module is already connected to D4 on the microprocessor.

The lesson code block.

Lesson 1

Code Analysis

Setup

D4 is automatically set to output as it’s used with the LED.
No coding needed.

Loop

  • Set D4 to Hi and so turn the LED on
  • Delay for 1000ms (1 second)
  • Set D4 to Lo and so turn the LED off
  • Delay for 1000ms

Loop means that this part gets continuously repeated.

How to create this ...

Watch the video on Youtube:



For this lesson, The LED module will be repeatedly on for 1 second and then off for 1 second.

Go to the next lesson to see how to download the program to the board. Then come back and try the following:

LED Brightness Adjustment:**

adjust led

On the Grove LED module, there is a variable resistor that can be adjusted using a screw driver. Twist it to make the LED light up brighter!


 TopicSubtopic
<  Prev:    
   
 This Category Links 
Category:Arduino Beginners Index:Arduino Beginners
  Next: > Grove Beginners kit