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
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
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 <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
// 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
// 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; |
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
// constants for the pins | |
const int ledPin = 2; | |
const int potPin = A7; | |
void setup() { | |
// set the led pin as an output | |
pinMode(ledPin, OUTPUT); | |
// open the serial port for communication | |
Serial.begin(9600); |
NewerOlder