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 the neopixel library | |
#include <Adafruit_NeoPixel.h> | |
int ledPin = 3; // the pin the LED data line is connected to | |
int numLED = 5; // number of LEDs you are controlling | |
// call the constructor | |
Adafruit_NeoPixel leds(numLED, ledPin, NEO_GRB + NEO_KHZ800); | |
int sensorPin = A0; // pin the sensor is attached to |
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 ledPin = 2; // the pin that the LED is attached to | |
void setup() { | |
// initialize the serial communication: | |
Serial.begin(9600); | |
// initialize the ledPin as an output: | |
pinMode(ledPin, 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 the libraries | |
#include <WiFiNINA.h> | |
#include "Adafruit_MQTT.h" | |
#include "Adafruit_MQTT_Client.h" | |
// wifi setup | |
#define WLAN_SSID "networkname" | |
#define WLAN_PASS "password" | |
// a.io setup |
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
// based off of Tom Igoe's version here : https://itp.nyu.edu/physcomp/lessons/accelerometers-gyros-and-imus-the-basics | |
#include <Arduino_LSM9DS1.h> | |
#include "MadgwickAHRS.h" | |
// initialize a Madgwick filter: | |
Madgwick filter; | |
// sensor's sample rate is fixed at 104 Hz: | |
const float sensorRate = 104.00; |
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 firstSensor = 0; // first analog sensor | |
int secondSensor = 0; // second analog sensor | |
int thirdSensor = 0; // digital sensor | |
int inByte = 0; // incoming serial byte | |
void setup() { | |
// start serial port at 9600 bps and wait for port to open: | |
Serial.begin(9600); | |
while(!Serial){ | |
;; |
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 enablePin= 5; | |
int ctrl1 = 3; | |
int ctrl2 = 2; | |
int button = 4; | |
int rotDirection = 1; | |
int buttState = false; | |
int preState = false; | |
void setup() { |
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 <CapacitiveSensor.h> | |
// create an instance of the library. pin 2 is the sensor | |
CapacitiveSensor capsense = CapacitiveSensor(4, 2); | |
void setup() { | |
// start serial | |
Serial.begin(9600); | |
pinMode(LED_BUILTIN, OUTPUT); | |
} |
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
// color mixing with common cathode rgb led | |
const int rPin = 4; | |
const int gPin = 3; | |
const int bPin = 2; | |
// value to increment/decrement | |
int rDir = 1; | |
int gDir = -1; | |
int bDir = -1; |
NewerOlder