Project showcase
Controlling LED

Controlling LED

Controlling LED by using Arduino Mega and Ethernet shield.

  • 3,032 views
  • 0 comments
  • 4 respects

Components and supplies

About this project

My project is IoT based controlling LED by using Arduino Mega and Ethernet shield through Cayenne plateform.

Add Cayenne Library to Arduino IDE

The Cayenne Library is a collection of code, known as sketch files, that makes it easy for you to connect and send data to and from sensors, actuators and devices connected to Arduino boards. Cayenne sketch files can be combined with other sketch files for your IoT projects.

The Cayenne Library is available directly from the Arduino IDE Libraries list. To install the library, select Sketch > Include library > Manage Libraries. The Library Manager dialog will appear. From here, search for the Cayenne library and install it.

In order to successfully program your Arduino board, you will need to verify that the appropriate Board and Port are selected in the Arduino IDE.

First, verify that the correct Board is selected in the Tools > Board menu. Be sure to select the board type that you will be programming.

Copy & paste the sketch file contents into Arduino IDE and select Sketch > Upload to upload the sketch file to your device.

After setting up your PC/Mac computer with the Arduino IDE and the Cayenne Library, you are ready to install Cayenne onto your device. Continue to Step 3 of the Arduino installation, where you will connect your board with Cayenne.

On this screen, select the Arduino board that you are using from the list of supported boards. As you select your Arduino board, a list of connections appears below the board name. Select the connection type that you are using.

Click Add New > Device / Widget.

  • Choose Actuator > Light > Luminosity.
  • Choose Virtual from the I/O field.
  • We will use Virtual Pin 1 for this example. Choose V1 from the Pin field.
  • Click the Step 1: Sketch File button to view the sketch file.

Code

Untitled fileArduino
//#define CAYENNE_DEBUG         // Uncomment to show debug messages
#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space
#include <CayenneEthernetW5200.h>

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "AuthenticationToken";

void setup()
{
	Serial.begin(9600);
	Cayenne.begin(token);
}

void loop()
{
	Cayenne.run();
}

Schematics

arduino_led_step2_bb_(1)_UxTzEmDe79.png
Arduino led step2 bb (1) uxtzemde79

Comments

Similar projects you might like

Controlling LED Using Blynk

by Patel Darshil

  • 10,331 views
  • 0 comments
  • 14 respects

Controlling LED Brightness Using Bolt and Arduino

Project tutorial by Devashish Gupta

  • 2,859 views
  • 8 comments
  • 19 respects

Bluetooth control led with lcd led status display real time.

Project tutorial by Youssef Sabaa

  • 25,951 views
  • 4 comments
  • 50 respects

LED Emergency Lights using WS2812 RGB LED Module

Project tutorial by bigboystoys13

  • 13,971 views
  • 7 comments
  • 33 respects

Controlling LED light intensity using smartphone light senso

Project tutorial by Nikola Travis

  • 2,661 views
  • 0 comments
  • 1 respect

Controlling an RGB LED with Color Detector Camera

Project tutorial by Zowail

  • 2,233 views
  • 0 comments
  • 1 respect
Add projectSign up / Login