This file contains 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 <Adafruit_NeoPixel.h> | |
#ifdef __AVR__ | |
#include <avr/power.h> | |
#endif | |
//pin that the strip is connected to | |
#define PIN 4 | |
//set some variables | |
const int firstbutton = 2; |
This file contains 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
//analog inout and output | |
int pot = 0; //stores pot value | |
int potPin = A0; | |
int redLED = 9; | |
int brightness1 = 0; //value to hold LED brightness | |
int brightness2 = 0; | |
int photoPin = A1; | |
int lightValue = 0; | |
int yellowLED = 10; |
This file contains 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 light = 0; | |
float frequency = 0; | |
void setup() { | |
// init serial comm | |
Serial.begin(9600); | |
pinMode(8, OUTPUT); | |
pinMode(A0, INPUT); |
This file contains 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 light = 0; | |
float frequency = 0; | |
void setup() { | |
// init serial comm | |
Serial.begin(9600); | |
pinMode(8, OUTPUT); | |
pinMode(A0, INPUT); |
This file contains 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 <Adafruit_NeoPixel.h> | |
#ifdef __AVR__ | |
#include <avr/power.h> | |
#endif | |
//pin that the strip is connected to | |
#define PIN 13 | |
//first argument is # pixels - change to how many you have | |
Adafruit_NeoPixel strip = Adafruit_NeoPixel(5, PIN, NEO_GRB + NEO_KHZ800); |
This file contains 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 <Adafruit_NeoPixel.h> | |
#ifdef __AVR__ | |
#include <avr/power.h> | |
#endif | |
//pin that the Neopixel strip is connected to | |
#define PIN 2 | |
int sad = LOW; //variable for when "lose" channel triggers | |
int jackpot = LOW; //variable for when "win" channel triggers |
This file contains 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 pot = 0; | |
int pot2 = 0; | |
int incoming; //variable for storing incoming data | |
void setup() { | |
Serial.begin(9600); | |
pinMode(2, OUTPUT); | |
} | |
void loop() { |
This file contains 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 <Servo.h> | |
//make instance of servo object | |
Servo mike; | |
void setup() { | |
// put your setup code here, to run once: | |
//attach servo motor |
This file contains 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
const int switchPin = 2; // switch input | |
const int motor1Pin = 3; // H-bridge leg 1 (pin 2, 1A) | |
const int motor2Pin = 5; // H-bridge leg 2 (pin 7, 2A) | |
const int enablePin = 9; // H-bridge enable pin | |
void setup() { | |
// set the switch as an input: | |
pinMode(switchPin, INPUT); | |
// set all the other pins you're using as outputs: |
This file contains 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
//Declare pin functions on Redboard | |
#define stp 2 | |
#define dir 3 | |
#define MS1 4 | |
#define MS2 5 | |
#define EN 6 | |
//Declare variables for functions | |
char user_input; | |
int x; |
OlderNewer