Skip to content

Instantly share code, notes, and snippets.

@futureshocked
Last active July 30, 2019 00:56
Show Gist options
  • Save futureshocked/b1f667b02361d4a38d40938523ef71c9 to your computer and use it in GitHub Desktop.
Save futureshocked/b1f667b02361d4a38d40938523ef71c9 to your computer and use it in GitHub Desktop.
This sketch demonstrates how to use the Grove LED kit.
/* 05.010 - Grove LED module
*
This sketch demonstrates how to use the Grove LED kit.
This module contains a header in which you can attach an LED. Take care
to connect the anode (long pin) of the LED into the socket marked with "+".
The cathode should go to the socket marked with "-".
You can use a Phillips screwdriver to adjust the brightens by turning the
on-board potentiometer.
Components
----------
- Grove Base Shield
- An Arduino Uno compatible board (such as Arduino/Genuino Uno or Seeeduino)
- Grove LED kit module
- An LED
- One Grove cable
IDE
---
Arduino IDE
Libraries
---------
-
Connections
-----------
Use a Grove cable to connect the module to Base Shield connector D4.
Other information
-----------------
- Use this sketch along side the video lecture 05.010 of Grove For Busy People
- Grove component: https://txplo.re/afed7
Github Gist
-----------
<script src="https://gist.github.com/futureshocked/b1f667b02361d4a38d40938523ef71c9.js"></script>
https://gist.github.com/futureshocked/b1f667b02361d4a38d40938523ef71c9
For course information, please go to https://techexplorations.com/product/grove-for-busy-people/
Created on July 5 2019 by Peter Dalmaris
*/
const int ledPin = 4;
// Connect the LED to Arduino digital pin 4
void setup() {
// initialize ledPin as an output.
pinMode(ledPin, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment