This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int ledPin=13; //This is a variable to store the pin number that we want the LED on | |
// the setup function runs once when you press reset or power the board | |
void setup() { | |
// initialize digital pin as an output. | |
pinMode(ledPin, OUTPUT); | |
} | |
// the loop function runs over and over again forever | |
void loop() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int ledPin=9; //Store LED pin number in this variable | |
void setup() { | |
//No need for setup this time | |
pinMode(ledPin,OUTPUT); //Setup pin 9 for OUTPUT | |
} | |
void loop() { | |
analogWrite(ledPin,0); //Turn the LED on pin 9 off | |
delay(500); //Wait 500 milliseconds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int ledPin=9; //Variable to store pin of LED | |
int potentPin=A0; //Variable to store pin of potentiometer | |
int potentValue=0; //Variable to store last known value of potentiometer | |
int brightnessValue=0; //Variable to store LED brightness | |
void setup() { | |
// put your setup code here, to run once: | |
pinMode(ledPin, OUTPUT); //Setup LED pin for output | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int ledPin=9; //Variable to store pin of LED | |
int potentPin=A0; //Variable to store pin of potentiometer | |
int potentValue=0; //Variable to store last known value of potentiometer | |
int brightnessValue=0; //Variable to store LED brightness | |
void setup() { | |
// put your setup code here, to run once: | |
Serial.begin(9600); //Setup serial console | |
pinMode(ledPin, OUTPUT); //Setup LED pin for output | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Process.h> | |
int ledPin=9; //Variable to store pin of LED | |
int potentPin=A0; //Variable to store pin of potentiometer | |
int potentValue=0; //Variable to store last known value of potentiometer | |
int brightnessValue=0; //Variable to store LED brightness | |
///////////////// | |
// Phant Stuff // | |
///////////////// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Process.h> //Library for Sparkfun network connection | |
///////////////////////////////// | |
// Data.SparkFun.Com variables // | |
//////////////////////////////// | |
// URL to phant server (only change if you're not using data.sparkfun | |
String phantURL = "http://data.sparkfun.com/input/"; | |
// Public key (the one you see in the URL): | |
String publicKey = "xxxxxx"; | |
// Private key, which only someone posting to the stream knows |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Process.h> | |
int ledPin=9; //Variable to store pin of LED | |
int potentPin=A0; //Variable to store pin of potentiometer | |
int potentValue=0; //Variable to store last known value of potentiometer | |
int brightnessValue=0; //Variable to store LED brightness | |
int moistPin=A1; //Variable to store pin of moisture sensor | |
int moistValue=0; //Variable to store moisture value | |
///////////////// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <YunClient.h> | |
#include <Adafruit_MQTT.h> | |
#include <Adafruit_MQTT_Client.h> | |
int ledPin = 9; | |
/************************* Adafruit.io Setup *********************************/ | |
#define AIO_SERVER "io.adafruit.com" | |
#define AIO_SERVERPORT 1883 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This is a basic program to report the value of a photoresistor to the Adafruit.io service. | |
//These libraries are needed to talk to the Internet and the Adafruit service | |
#include <YunClient.h> | |
#include <Adafruit_MQTT.h> | |
#include <Adafruit_MQTT_Client.h> | |
int photoPin=A0; //Variable to store pin of photoresistor | |
float photoValue=0; //Variable to store last known value of photoresistor |