testing speed & position

testing speed & position


Create FlightController.ino

Create FlightController.ino

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/GaParmar/quadcopter.git/'


Example GaussianRandomPlot created

Example GaussianRandomPlot created

This example helps to understand what is the new method "random" of
Gaussian.

error: pathspec 'examples/GaussianRandomPlot/GaussianRandomPlot.ino' did not match any file(s) known to git

--- examples/GaussianRandomPlot/GaussianRandomPlot.ino
+++ examples/GaussianRandomPlot/GaussianRandomPlot.ino
@@ -0,0 +1,78 @@
+#include <Gaussian.h>
+void setup() {
+	Serial.begin(9600);
+	Serial.println("\n\nStarting Random Gaussian Distribuition...");
+	delay(20);
+	randomSeed(analogRead(0));
+}
+
+// The number of "slots" to record the hits of gaussian random
+#define SIZE 36
+
+// How many tests will be performed
+#define TESTS 10000
+
+// How many characters will have, in width?
+#define BAR_SIZE 40
+
+void loop() {
+	Gaussian g1 = Gaussian(0, 10);
+	long zero = SIZE/2 - g1.mean;
+	long hits[SIZE] = {0};
+
+	// Zero the array
+	for(int i = 0; i < SIZE; i++)
+		hits[i] = 0;
+
+	// Print Header (0% ------------- 100%)
+	Serial.print("0% ");
+
+	for(int i = 3; i < BAR_SIZE - 5; i++)
+		Serial.print("-");
+
+	Serial.println(" 100%");
+
+	// Process the gaussians and randomize 'TESTS' times
+	int lastStep = 0, step;
+	Serial.print("=");
+	for(int i = 0; i < TESTS; i++){
+		step = (double)i/TESTS*BAR_SIZE;
+		if(step > lastStep){
+			Serial.print("=");
+			lastStep = step;
+		}
+
+		double val = g1.random();
+		int place = (int)val - g1.mean + zero;
+		place = constrain(place, 0, SIZE);
+		hits[place]++;
+	}
+	Serial.print(" END!\n");
+
+	// Just to scale the plot on the Serial, to improve visualization
+	long maxHit = 0;
+	for(int i = 0; i < SIZE; i++){
+	maxHit = max(maxHit, hits[i]);
+		// Uncomment this line if you want to see the NUMBER of hits
+		// Serial.println(hits[i]);
+	}
+
+	// This will print the bar graphic
+	double scale = (double)maxHit/BAR_SIZE;
+	Serial.print("Scale: ");
+	Serial.print(scale);
+	Serial.print("\tMaxHit: ");
+	Serial.println(maxHit);
+
+	for(int i = 0; i < SIZE; i++){
+		int len = hits[i]/scale;
+
+		for(int x = 0; x < len; x++)
+			Serial.print("=");
+
+		Serial.print("\n");
+	}
+
+	// Wait until dinosaurs come back on earth
+	while(1);
+}


updated example

updated example

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/arduino-org/CiaoMCU.git/'


Código fonte de comunicação serial com o arduino


Update firmware examples with the readtag.ino example frm arduino

error: pathspec 'firmware/examples/readTag/readtag.ino' did not match any file(s) known to git

--- firmware/examples/readTag/readtag.ino
+++ firmware/examples/readTag/readtag.ino
@@ -0,0 +1,23 @@
+#include <Wire.h>
+#include <PN532_I2C.h>
+#include <PN532.h>
+#include <NfcAdapter.h>
+
+PN532_I2C pn532_i2c(Wire);
+NfcAdapter nfc = NfcAdapter(pn532_i2c);
+
+void setup(void) {
+    Serial.begin(9600);
+    Serial.println("NDEF Reader");
+    nfc.begin();
+}
+
+void loop(void) {
+    Serial.println("\nScan a NFC tag\n");
+    if (nfc.tagPresent())
+    {
+        NfcTag tag = nfc.read();
+        tag.print();
+    }
+    delay(5000);
+}


add arduino code

add arduino code

error: pathspec 'arduino/kegmeter.ino' did not match any file(s) known to git

--- arduino/kegmeter.ino
+++ arduino/kegmeter.ino
@@ -0,0 +1,82 @@
+/* -*- mode: c -*- */
+
+#define NUM_PINS_TAP 4
+#define NUM_PINS_TEMP 2
+#define PIN_LED 11
+
+#define PIN_NUM_TAP(x) (21 - x)
+#define PIN_NUM_TEMP(x) (21 - NUM_PINS_TAP - x)
+
+#define NUM_PINS (NUM_PINS_TAP + NUM_PINS_TEMP)
+
+const int pin_bytes = sizeof(uint64_t);
+const int bufsize = 8 + (NUM_PINS * pin_bytes);
+
+volatile uint64_t pulses[NUM_PINS_TAP];
+uint8_t last_state[NUM_PINS_TAP];
+byte buffer[bufsize] = {0};
+
+void setup() {
+  Serial.begin(9600);
+
+  for(int i = 0; i < NUM_PINS_TAP; i++) {
+    pinMode(PIN_NUM_TAP(i), INPUT_PULLUP);
+    pulses[i] = 0;
+    last_state[i] = digitalRead(PIN_NUM_TAP(i));
+  }
+
+  for(int i = 0; i < NUM_PINS_TEMP; i++) {
+    pinMode(PIN_NUM_TEMP(i), INPUT);
+  }
+
+  OCR0A = 0xAF;
+  TIMSK0 |= _BV(OCIE0A); // what
+
+  buffer[0] = bufsize;
+  buffer[1] = NUM_PINS_TAP;
+  buffer[2] = NUM_PINS_TEMP;
+  buffer[3] = NUM_PINS;
+}
+
+SIGNAL(TIMER0_COMPA_vect) {
+  for(int i = 0; i < NUM_PINS_TAP; i++) {
+    uint8_t state = digitalRead(PIN_NUM_TAP(i));
+
+    if(state != last_state[i]) {
+      pulses[i]++;
+    }
+
+    last_state[i] = state;
+  }
+}
+
+void loop() {
+  uint64_t tmp;
+
+  if(Serial.available() > 0) {
+    Serial.read();
+    digitalWrite(PIN_LED, HIGH);
+
+    for(int i = 0; i < NUM_PINS_TAP; i++) {
+      tmp = pulses[i];
+      memcpy(&buffer[(i + 1) * pin_bytes], &tmp, pin_bytes);
+
+      pulses[i] = 0;
+    }
+
+    for(int i = 0; i < NUM_PINS_TEMP; i++) {
+      tmp = (uint64_t)analogRead(PIN_NUM_TEMP(i));
+      memcpy(&buffer[(i + 1 + NUM_PINS_TAP) * pin_bytes], &tmp, pin_bytes);
+    }
+
+    Serial.write(buffer, bufsize);
+  }
+  else {
+    digitalWrite(PIN_LED, LOW);
+  }
+
+  delay(100);
+}
+
+
+


Add Mr Slim Halloween Project

Add Mr Slim Halloween Project

error: pathspec 'Scary_Skull_Eyes_with_Sound/Scary_Skull_Eyes_with_Sound.ino' did not match any file(s) known to git

--- Scary_Skull_Eyes_with_Sound/Scary_Skull_Eyes_with_Sound.ino
+++ Scary_Skull_Eyes_with_Sound/Scary_Skull_Eyes_with_Sound.ino
@@ -0,0 +1,140 @@
+/*********************************************************************
+ * Scary Halloween Skull Eyes with Sound
+ * Author: Darrell Little
+ * Date: October 15, 2017
+ * This software is in the Public Domain
+ * Creative Commons Zero v1.0 Universal
+ * The Creative Commons CC0 Public Domain Dedication waives copyright interest
+ * in any work created and dedicates it to the world-wide public domain.
+ *
+ * PIR sensor power is connected to 5 volts, negative to ground
+ * Use a function to return a boolean (True or False) if the PIR
+ * sensor detects motion
+ *
+ * When motion is detected
+ * play an audio file while
+ * flashing the LED eyes multiple times using a function by passing it
+ * number of times to blink and delay time.
+ *
+ * MP3 Player Credits
+ * Based on open source library:
+ *   DFPlayer - A Mini MP3 Player For Arduino
+ *   <https://www.dfrobot.com/index.php?route=product/product&product_id=1121>
+ *   <Angelo.qiao@dfrobot.com>
+ *   WARNING: Must use voltage dropping 1k resistors on software serial TX/RX lines
+ *   to the DFPlayer.
+ *
+ * Additional credits to Let's Code Blacksburg workshop
+ * https://github.com/LetsCodeBlacksburg/arduino-talking-skull
+ * LCBB_Talking-Skull_ping-servo-dfplayer_complete
+ * By tweeks-pub1@theweeks.org
+ *
+ *********************************************************************/
+
+#include <SoftwareSerial.h>
+#include <DFRobotDFPlayerMini.h>
+
+// Set the constant values and variables used
+const int led1 = 11; // one of two LED eyes
+const int led2 = 10; // second of two LED eyes
+const int pir = 6; // pin connected to the PIR sensor output
+int sensorValue = LOW; // initial value of sensor reading
+
+// DFPlayer mp3 player variables
+const int ardRX = 2;       // The SoftwareSerial Receive line (Use 1K resistor, goes to DFPlayer TX)
+const int ardTX = 3;       // The SoftwareSerial Transmit line (Use 1K resistor, goes to DFPlayer RX)
+const int dfBusy = 12;     // Coming from DFPlayer pin 16, is active low (HIGH = not playing a sound)
+int soundFile = 1;           // initial soundFile value
+int fileCount = 15;         // Either set the # of files on SD card, or load it from myDFPlayer.readFileCounts()
+int setVol = 20;           //Set volume value (0~30)
+
+// Create SoftwareSerial instance
+SoftwareSerial mySoftwareSerial(ardRX,ardTX); // Set the RX, TX pins
+
+// Create DFPlayer instance
+DFRobotDFPlayerMini myDFPlayer;
+
+// Function to initialize the DFPlayer
+void initDFPlayer() {
+  if (myDFPlayer.begin(mySoftwareSerial)) {
+    // configure settings
+    myDFPlayer.setTimeOut(500); //Set serial communictaion time out 500ms
+    myDFPlayer.volume(setVol);  //Set volume value (0~30).
+    myDFPlayer.EQ(DFPLAYER_EQ_NORMAL);
+    myDFPlayer.outputDevice(DFPLAYER_DEVICE_SD);
+  }
+}
+
+// Function for reading the PIR sensor
+// Return true if motion is detected
+boolean isMotionDetected() {
+  sensorValue = digitalRead(pir);
+  if (sensorValue == HIGH) { // the sensor reads HIGH if motion is detected
+    return true;
+  }
+  else
+  {
+    return false; // no motion
+  }
+}
+
+// Function to blink the eyes rapidly multiple times
+// pass to the function two values
+void blinkEyes(int blinkRepeats, int waitTime) {
+  for (int i = 0; i < blinkRepeats; i++) {
+    turnOnEyes();
+    delay(waitTime);
+    turnOffEyes();
+    delay(waitTime);
+  }
+}
+
+// Function to turn on the LED eyes
+void turnOnEyes() {
+  digitalWrite(led1, HIGH);
+  digitalWrite(led2, HIGH);
+}
+
+// Function to turn off the LED eyes
+void turnOffEyes() {
+  digitalWrite(led1, LOW);
+  digitalWrite(led2, LOW);
+}
+
+void setup() {
+  // Put your setup code here, initialize the pins as input or output
+  pinMode(pir, INPUT);
+  pinMode(led1, OUTPUT);
+  pinMode(led2, OUTPUT);
+  pinMode(ardRX, INPUT);
+  pinMode(ardTX, OUTPUT);
+  pinMode(dfBusy, INPUT);
+  // Start SoftwareSerial, initialize DFPlayer
+  mySoftwareSerial.begin(9600);
+  initDFPlayer();
+
+} // end of setup() function
+
+void loop() {
+  // put your main code logic here, to run repeatedly
+  // If played the last soundFile, then reset to 1
+  if (soundFile == fileCount+1) {
+    soundFile = 1;
+  }
+
+  if (isMotionDetected()) {
+    myDFPlayer.play(soundFile);  // Play the next mp3 file
+    delay(100);
+    while(digitalRead(dfBusy) == false) {
+      // Blink the LED eyes while mp3 is playing
+      blinkEyes(3,150);
+    }
+
+  soundFile++;  // Increment the file number
+  delay(3000);
+  }
+  else {
+    turnOffEyes();
+  }
+
+} // end of loop() function


Added delay before time log to send at correct intervals

error: pathspec 'unit' did not match any file(s) known to git
error: pathspec 'tests/pwm_detector_test/pwm_detector_test.ino' did not match any file(s) known to git


Create yun_modbus_example.ino

Create yun_modbus_example.ino

Initial

error: pathspec 'yun_modbus_example.ino' did not match any file(s) known to git

--- yun_modbus_example.ino
+++ yun_modbus_example.ino
@@ -0,0 +1,31 @@
+
+#include <Bridge.h>
+
+Process p;
+#define BUF_SIZE 32
+char buf[BUF_SIZE];
+
+void setup() {
+  Serial.begin(115200);
+  // Start the bridge
+  Bridge.begin();
+  // Start the modbus server
+  p.begin("python");
+  p.addParameter("/mnt/sd/modbus_tcp_slave.py"); // modbus float holding registers
+  p.addParameter("40001");                       // read only start address
+  p.addParameter("6");                           // read only number of holding registers
+  p.addParameter("40101");                       // read/write start address (optional)
+  p.addParameter("6");                           // read/write number of holding registers (optional)
+  p.runAsynchronously();
+}
+void loop() {
+  // AVR -> WRT (modbus read only), write some values to the modbus server
+  Bridge.put("40001", String(PI));
+  Bridge.put("40003", String(millis()));
+  Bridge.put("40005", String(5280));
+
+  // AVR <- WRT (modbus read/write), read some values from the modbus server
+  Bridge.get("40101", buf, BUF_SIZE);
+  Serial.println(atof(buf));
+  delay(500);
+}


First Commit: Agent Code for ArduinoUNO Agent publishes values of all the Analog Pins and the given Digital Pins to the WSO2 BAM via the Service Endpoint at WSO2 AS.

error: pathspec 'WSO2ArduinoAgent/WSO2ArduinoAgent.ino' did not match any file(s) known to git

--- WSO2ArduinoAgent/WSO2ArduinoAgent.ino
+++ WSO2ArduinoAgent/WSO2ArduinoAgent.ino
@@ -0,0 +1,182 @@
+#include <Ethernet.h>
+#include <SPI.h>
+
+#define DEVICE_IP "192.168.1.218"
+#define SERVICE_IP "192.168.1.216"
+#define SERVICE_PORT 9763
+#define SERVICE_EPOINT "/WSO2ConnectedDevices_1.0.0/services/connected_device/pushdata/"  //ip/owner/type/mac/pin/value
+#define DEVICE_OWNER "smean"
+#define DEVICE_TYPE "arduino-uno"
+#define PUBLISH_INTERVAL 30000
+
+enum IP_TYPE{
+  SERVER,
+  DEVICE
+};
+
+enum PIN_STATE{
+  low,
+  high
+};
+
+byte mac[] = { 0x90, 0xA2, 0xDA, 0x0D, 0x30, 0xD7 };  //mac - 90a2da0d30d7
+byte dns2[] = { 8, 8, 8, 8 };
+byte subnet[] = { 255, 255, 255, 0 };
+byte gateway[] = { 192, 168, 1, 1 };
+
+byte deviceIP[4] = { 0, 0, 0, 0 };
+byte server[4] = { 0, 0, 0, 0 };
+
+int pins[] = { 2, 5, 8, 9, 12 };
+
+EthernetClient client;
+String connecting = "connecting.... ";
+String resource, tempResource, host;
+
+void setup()
+{
+  for ( int pin = 0; pin < (sizeof(pins)/sizeof(int)); pin++) {
+    pinMode(pins[pin], OUTPUT);
+  }
+
+  Serial.begin(9600);
+  Serial.println("-------------------------------");
+  setIP(SERVICE_IP, SERVER);
+  setIP(DEVICE_IP, DEVICE);
+  Ethernet.begin(mac, deviceIP, dns2, gateway, subnet);
+
+  Serial.print("My IP: ");
+  Serial.println(Ethernet.localIP());
+  connecting += client.connect(server, SERVICE_PORT);
+  delay(3000);
+  Serial.println(connecting);
+
+  String port = String(SERVICE_PORT);
+  host = String(SERVICE_IP);
+  host = "Host: " + host + ":" + port;    //  Serial.println(host);
+
+  resource = String(SERVICE_EPOINT) + String(SERVICE_IP) + "/" +  String(DEVICE_OWNER) + "/" + String(DEVICE_TYPE) + "/";
+
+  for ( int i = 0; i < sizeof(mac); i++ ) {
+    if( mac[i] < 16){
+      resource = resource + "0" + String(mac[i], HEX);
+    }else{
+      resource += String(mac[i], HEX);
+    }
+//    Serial.print(mac[i]);  Serial.print(" - ");   Serial.print(mac[i], HEX);  Serial.println();
+  }
+
+  if (client.connected()) {
+    Serial.println("connected");
+  } else {
+    Serial.println("connection failed");
+  }
+
+}
+
+void loop()
+{
+  alternatePinValue();
+
+  if (client.connected()) {
+    pushAnalogPinData();
+    pushDigitalPinData();
+  } else {
+    Serial.println("client not found...");
+    Serial.println("disconnecting.");
+    client.stop();
+    for(;;)
+      ;
+  }
+//  delay(PUBLISH_INTERVAL);
+}
+
+
+void pushDigitalPinData(){
+  for ( int pin = 0; pin < (sizeof(pins)/sizeof(int)); pin++) {
+    Serial.println("-------------------------------");
+    tempResource = resource + "/D" + pins[pin] + "/";
+
+    if (digitalRead(pins[pin]) == low) {
+      tempResource += "LOW";
+    } else {
+      tempResource += "HIGH";
+    }
+
+    tempResource = "POST " + tempResource + " HTTP/1.1";    //Serial.println(tempResource);
+
+    client.println(tempResource);
+    client.println(host);
+    client.println();
+    delay(2000);
+
+    while (client.available()) {
+      char response = client.read();
+      Serial.print(response);
+    }
+
+    Serial.println();
+    tempResource = "";
+    delay(4000);
+  }
+}
+
+void pushAnalogPinData(){
+  for ( int analogChannel = 0; analogChannel < 6; analogChannel++ ) {
+    Serial.println("-------------------------------");
+    tempResource = resource + "/A" + analogChannel + "/" + analogRead(analogChannel);
+    tempResource = "POST " + tempResource + " HTTP/1.1";    Serial.println(tempResource);
+
+    client.println(tempResource);
+    client.println(host);
+    client.println();
+    delay(2000);
+
+    while (client.available()) {
+      char response = client.read();
+      Serial.print(response);
+    }
+
+    Serial.println();
+    tempResource = "";
+    delay(4000);
+  }
+}
+
+void alternatePinValue(){
+  for ( int pin = 0; pin < (sizeof(pins)/sizeof(int)); pin++) {
+    if(digitalRead(pins[pin]) == low) {
+      digitalWrite(pins[pin], HIGH);
+    } else {
+      digitalWrite(pins[pin], LOW);
+    }
+  }
+}
+
+void setIP(String ip, int type){
+  int dot3 = ip.lastIndexOf( "." );
+  String ip_4 = ip.substring( dot3 + 1, ip.length() );
+
+  int dot2 = ip.lastIndexOf( "." , dot3 - 1 );
+  String ip_3 = ip.substring( dot2 + 1, dot3 );
+
+  int dot1 = ip.indexOf( "." );
+  String ip_2 = ip.substring( dot1 + 1, dot2 );
+  String ip_1 = ip.substring( 0, dot1 );
+
+  switch(type){
+    case SERVER:
+      server[3] = ip_4.toInt();    //      Serial.println(server[3]);
+      server[2] = ip_3.toInt();    //      Serial.println(server[2]);
+      server[1] = ip_2.toInt();    //      Serial.println(server[1]);
+      server[0] = ip_1.toInt();    //      Serial.println(server[0]);
+      break;
+
+    case DEVICE:
+      deviceIP[3] = ip_4.toInt();  //      Serial.println(deviceIP[3]);
+      deviceIP[2] = ip_3.toInt();  //      Serial.println(deviceIP[2]);
+      deviceIP[1] = ip_2.toInt();  //      Serial.println(deviceIP[1]);
+      deviceIP[0] = ip_1.toInt();  //      Serial.println(deviceIP[0]);
+      break;
+  }
+}


Create adxl345multi.ino

Create adxl345multi.ino

error: pathspec 'src/adxl345multi.ino' did not match any file(s) known to git

--- src/adxl345multi.ino
+++ src/adxl345multi.ino
@@ -0,0 +1 @@
+


Bumping version number for release.

Bumping version number for release.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/FirstBuild/pizzaduino.git/'


Cerveau: AI - update screen pins

Cerveau: AI - update screen pins

error: pathspec 'Module' did not match any file(s) known to git
error: pathspec 'Cerveau/Artificial' did not match any file(s) known to git
error: pathspec 'Intelligence/ai/ai/ai.ino' did not match any file(s) known to git


Update RELAY_BETA.ino

Update RELAY_BETA.ino

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/Garuda-1/RealityGateway.git/'


Beam IFTTT example code added

Beam IFTTT example code added

*Currently supports FITBIT

error: pathspec 'examples/BeamIFTTT/BeamIFTTT.ino' did not match any file(s) known to git

--- examples/BeamIFTTT/BeamIFTTT.ino
+++ examples/BeamIFTTT/BeamIFTTT.ino
@@ -0,0 +1,71 @@
+/*
+===========================================================================
+
+  This is an example for Beam.
+
+  Beam is a beautiful LED matrix — features 120 LEDs that displays scrolling text, animations, or custom lighting effects.
+  Beam can be purchased here: http://www.hoverlabs.co
+
+  Written by Emran Mahbub and Jonathan Li for Hover Labs.
+  BSD license, all text above must be included in any redistribution
+
+
+#  HISTORY
+    v1.0  -  Initial Release
+
+#  INSTALLATION
+    The 4 library files (beam.cpp, beam.h and charactermap.h and frames.h) are required to run Beam.
+    Run the BeamDemo.ino file.
+
+#  SUPPORT
+    For questions and comments, email us at support@hoverlabs.co
+===========================================================================
+*/
+
+#include "application.h"
+#include "beam.h"
+
+/* pin definitions for Beam */
+#define RSTPIN 2        //use any digital pin
+#define IRQPIN 9        //currently not used
+#define BEAMCOUNT 1     //number of beams daisy chained together
+
+/* Iniitialize an instance of Beam */
+Beam b = Beam(RSTPIN, IRQPIN, BEAMCOUNT);
+
+/* Timer used by the demo loop */
+unsigned long updateTimer = 0;
+int demo = 0;
+
+void setup() {
+
+    Serial.begin(9600);
+    Wire.begin();
+
+    Serial.println("Starting Beam example");
+
+    Particle.subscribe("Fitbit_Steps", fitbitHandler);
+
+}
+
+    void fitbitHandler(const char *event, const char *data)
+    {
+
+       const char* stats = data;
+       b.begin();
+       b.print(stats);
+       b.setLoops(7);
+       b.setSpeed(4);
+       b.setMode(SCROLL);
+       b.play();
+
+    }
+
+void loop() {
+
+
+
+
+    // do something else here
+
+}


fix communication with rpi & bluetooth. tested. works find

error: pathspec 'exploration' did not match any file(s) known to git
error: pathspec 'testing/src/main.ino' did not match any file(s) known to git


Create Treadmill.ino

Create Treadmill.ino

error: pathspec 'Treadmill/Treadmill.ino' did not match any file(s) known to git

--- Treadmill/Treadmill.ino
+++ Treadmill/Treadmill.ino
@@ -0,0 +1,39 @@
+int set_speed = 0, set_speed_old = 0;
+
+void setup(){
+  Serial.begin(115200);
+
+  pinMode(CS, OUTPUT);
+  pinMode(UD, OUTPUT);
+  pinMode(CLK, OUTPUT);
+
+  //hold current pot resistance
+  digitalWrite(CS, HIGH);
+  digitalWrite(CLK, HIGH);
+}
+
+void loop(){
+  if (Serial.available() > 0){
+    char c = Serial.read();
+    //convert char to int
+    set_speed = c - '0';
+  }
+
+  if (set_speed > set_speed_old){
+    digitalWrite(CS, LOW);
+    digitalWrite(UD, LOW);
+    digitalWrite(CLK, LOW);
+    digitalWrite(CLK, HIGH);
+  }
+
+  else if(set_speed < set_speed_old){
+    digitalWrite(CS, LOW);
+    digitalWrite(UD, HIGH);
+    digitalWrite(CLK, LOW);
+    digitalWrite(CLK, HIGH);
+  }
+
+  else {
+    digitalWrite(CS, HIGH);
+  }
+}


add serial controller for esplora

add serial controller for esplora

error: pathspec 'esplora_serial_controller/esplora_serial_controller.ino' did not match any file(s) known to git

--- esplora_serial_controller/esplora_serial_controller.ino
+++ esplora_serial_controller/esplora_serial_controller.ino
@@ -0,0 +1,21 @@
+#include <Esplora.h>
+
+String inputString = "";         // a string to hold incoming data
+boolean stringComplete = false;  // whether the string is complete
+
+void setup() {
+  while (!Serial); // needed for Leonardo-based board like Esplora
+  Serial.begin(57600);
+  Serial1.begin(57600);
+}
+
+void loop() {
+  if (Serial1.available())
+     Serial.write(Serial1.read());
+
+
+  delay(0.1);
+
+}
+
+


Added IndentedPrint example

Added IndentedPrint example

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/CanTireInnovations/ArduinoJson.git/'


Add example for pairing with AccelStepper library

error: pathspec 'examples/TMC2130_AccelStepper/TMC2130_AccelStepper.ino' did not match any file(s) known to git

--- examples/TMC2130_AccelStepper/TMC2130_AccelStepper.ino
+++ examples/TMC2130_AccelStepper/TMC2130_AccelStepper.ino
@@ -0,0 +1,46 @@
+/**
+ * Author Teemu Mäntykallio
+ * Initializes the library and turns the motor in alternating directions.
+*/
+
+#define EN_PIN    38  // Nano v3:   16 Mega:    38  //enable (CFG6)
+#define DIR_PIN   55  //            19          55  //direction
+#define STEP_PIN  54  //            18          54  //step
+#define CS_PIN    40  //            17          40  //chip select
+
+constexpr uint32_t steps_per_mm = 80;
+
+#include <TMC2130Stepper.h>
+TMC2130Stepper driver = TMC2130Stepper(EN_PIN, DIR_PIN, STEP_PIN, CS_PIN);
+
+#include <AccelStepper.h>
+AccelStepper stepper = AccelStepper(stepper.DRIVER, STEP_PIN, DIR_PIN);
+
+void setup() {
+    Serial.begin(9600);
+    while(!Serial);
+    Serial.println("Start...");
+    pinMode(CS_PIN, OUTPUT);
+    digitalWrite(CS_PIN, HIGH);
+    driver.begin();             // Initiate pins and registeries
+    driver.rms_current(600);    // Set stepper current to 600mA. The command is the same as command TMC2130.setCurrent(600, 0.11, 0.5);
+    driver.stealthChop(1);      // Enable extremely quiet stepping
+    driver.stealth_autoscale(1);
+    driver.microsteps(16);
+
+    stepper.setMaxSpeed(50*steps_per_mm); // 100mm/s @ 80 steps/mm
+    stepper.setAcceleration(1000*steps_per_mm); // 2000mm/s^2
+    stepper.setEnablePin(EN_PIN);
+    stepper.setPinsInverted(false, false, true);
+    stepper.enableOutputs();
+}
+
+void loop() {
+    if (stepper.distanceToGo() == 0) {
+        stepper.disableOutputs();
+        delay(100);
+        stepper.move(100*steps_per_mm); // Move 100mm
+        stepper.enableOutputs();
+    }
+    stepper.run();
+}


Se crea proyecto arduino_sensor_humedad.ino

error: pathspec 'arduino_sensor_humedad/arduino_sensor_humedad.ino' did not match any file(s) known to git

--- arduino_sensor_humedad/arduino_sensor_humedad.ino
+++ arduino_sensor_humedad/arduino_sensor_humedad.ino
@@ -0,0 +1,16 @@
+/*Sensor de humedad con arduino
+*
+* Copyright: codigoelectronica.com
+* Author: Oscar Fernandez
+* License: MIT
+*/
+
+void setup() {
+  Serial.begin(57600);
+}
+
+void loop() {
+  Serial.print("Moisture Sensor Value:");
+  Serial.println(analogRead(A0));
+  delay(100);
+}


Bug fixes

Bug fixes

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/auvnitrkl/tiburon-3.0.git/'


Added an example

Added an example

error: pathspec 'example/RotaryEncoderExample/RotaryEncoderExample.ino' did not match any file(s) known to git

--- example/RotaryEncoderExample/RotaryEncoderExample.ino
+++ example/RotaryEncoderExample/RotaryEncoderExample.ino
@@ -0,0 +1,61 @@
+/**************************************************************************/
+/*!
+    @file     RotaryEncoder.h
+    @author   Jason Scheunemann <jason.scheunemann@gmail.com>
+
+    @section LICENSE
+
+    Software License Agreement (BSD License)
+
+    Copyright (c) 2016, Jason Scheunemann
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+    1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+    2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+    3. Neither the name of the copyright holders nor the
+    names of its contributors may be used to endorse or promote products
+    derived from this software without specific prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**************************************************************************/
+
+#include <RotaryEncoder.h>
+
+#define PIN_A 2
+#define PIN_B 3
+
+RotaryEncoder encoder = RotaryEncoder(PIN_A, PIN_B);
+
+void setup() {
+  encoder.incrementHandler(onIncrement);
+  encoder.decrementHandler(onDecrement);
+  encoder.begin();
+  Serial.begin(9600);
+}
+
+void loop() {
+  encoder.read();
+}
+
+void onIncrement(RotaryEncoder &source){
+  Serial.println("Increment");
+}
+
+void onDecrement(RotaryEncoder &source){
+  Serial.println("Decrement");
+}


Updated comment

Updated comment

--- IRRanger/examples/DistanceFromObject/DistanceFromObject.ino
+++ IRRanger/examples/DistanceFromObject/DistanceFromObject.ino
@@ -1,77 +1,77 @@
-/**
- * A simple example showcasing the functionality of the library
- * The distance reported by the sensor, gets written on the serial port
- * and then sets the duty cycle and blinks the onboard LED
- *
- * Notes:
- * AREF: If your project uses an external voltage reference, then you should
- *       specify that reference voltage to the IRRanger instance with the setARef method
- * resetARef: Resets the reference to the default internal voltage level
- *            Please read this first -> http://arduino.cc/en/Reference/AnalogReference
- * Repeated measurements: You can set a number of successive measurements to be made
- *                        and then take their average as the final result. This might be
- *                        desirable since the sensor's output varies a bit.
- *                        Don't overdo it! For every additional measurement, a default
- *                        50ms delay is applied in order for the sensor to refresh.
- * Point of reference: If you want to find the distance of an object, not from
- *                     the sensor, but from another point of reference (perhaps the
- *                     center of your robot), then you can state the distance (in cm)
- *                     of the sensor from that point of interest either during the
- *                     initialization of an instance by supplying a third argument to
- *                     the constructor, or later with the setPRef method. From thereafter
- *                     this value will be getting added to every measurement you take.
- *                     This has a sensible meaning only when we are talking about
- *                     units of length, and hence it will apply only when calling
- *                     methods getCM() and getIN().
- */
-
-#include "IRRanger.h"  // Includes the IRRanger library
-
-int LED = 13;  // Onboard LED
-
-int PIN = A0;  // Pin for sensor's output
-
-// Initializes a library instance with the part code of the sensor
-// { GP2D120XJ00F, GP2Y0A21YK, GP2Y0A02YK0F }, the input pin, and
-// a value (in cm) to be added on every measurement, as a distance
-// of the sensor from a desired point of reference
-IRRanger ir(GP2D120XJ00F, PIN, 5);
-
-void setup()
-{
-    Serial.begin(9600);  // Initializes serial port
-    // Waits for serial port to connect. Needed for Leonardo only
-    while ( !Serial ) ;
-
-    pinMode(LED, OUTPUT);
-
-    // If you have fitted a curve for your sensor, you can set the model here
-    // The available model families are:
-    //   * Sum of exponentials: a * exp(b * x) + c * exp(d * x)
-    //   * 5th order polynomial: a * x^5 + b * x^4 + c * x^3 + d * x^2 + e * x + f
-    // So, you can set the model to an exponential, a sum of expontials,
-    // or a polynomial up to 5th order
-    // First argument to setModel is the model type { EXPS, POLY5 }
-    // e.g. a = ..; b = ..; c = ..; d = ..; e = ..; f = ..;
-    //      ir.setModel(EXPS, a, b, c, d);  // sum of exponentials
-    // or   ir.setModel(EXPS, a, b);  // exponential
-    // or   ir.setModel(POLY5, a, b, c, d, e, f);  // 5th order polynomial
-    // or   ir.setModel(POLY5, 0, 0, c, d, e, f);  // 3rd order polynomial
-}
-
-void loop()
-{
-    double distance = ir.getCM();  // Gets a distance in cm
-    double duty_cycle = ir.getRaw() / 1023.;  // Defines a ratio
-
-    // Writes distance on the serial port
-    Serial.print(distance);
-    Serial.println("cm");
-
-    // Blinks the onboard LED
-    digitalWrite(LED, HIGH);
-    delay((int)(duty_cycle * 300));
-    digitalWrite(LED, LOW);
-    delay((int)((1-duty_cycle) * 300));
-}
+/**
+ * A simple example showcasing the functionality of the library
+ * The distance reported by the sensor, gets written on the serial port
+ * and then sets the duty cycle and blinks the onboard LED
+ *
+ * Notes:
+ * AREF: If your project uses an external voltage reference, then you should
+ *       specify that reference voltage to the IRRanger instance with the setARef method
+ * resetARef: Resets the reference to the default internal voltage level
+ *            Please read this first -> http://arduino.cc/en/Reference/AnalogReference
+ * Repeated measurements: You can set a number of successive measurements to be made
+ *                        and then take their average as the final result. This might be
+ *                        desirable since the sensor's output varies a bit.
+ *                        Don't overdo it! For every additional measurement, a default
+ *                        50ms delay is applied in order for the sensor to refresh.
+ * Point of reference: If you want to find the distance of an object, not from
+ *                     the sensor, but from another point of reference (perhaps the
+ *                     center of your robot), then you can state the distance (in cm)
+ *                     of the sensor from that point of interest either during the
+ *                     initialization of an instance by supplying a third argument to
+ *                     the constructor, or later with the setPRef method. From thereafter
+ *                     this value will be getting added to every measurement you take.
+ *                     This has a sensible meaning only when we are talking about
+ *                     units of length, and hence it will apply only when calling
+ *                     methods getCM() and getIN().
+ */

+#include "IRRanger.h"  // Includes the IRRanger library
+
+int LED = 13;  // Onboard LED
+
+int PIN = A0;  // Pin for sensor's output
+
+// Initializes a library instance with the part code of the sensor
+// { GP2D120XJ00F, GP2Y0A21YK, GP2Y0A02YK0F }, the input pin, and
+// a value (in cm) to be added on every measurement, as a distance
+// of the sensor from a desired point of reference
+IRRanger ir(GP2D120XJ00F, PIN, 5);
+
+void setup()
+{
+    Serial.begin(9600);  // Initializes serial port
+    // Waits for serial port to connect. Needed for Leonardo only
+    while ( !Serial ) ;
+
+    pinMode(LED, OUTPUT);
+
+    // If you have fitted a curve for your sensor, you can set the model here
+    // The available model families are:
+    //   * Sum of exponentials: a * exp(b * x) + c * exp(d * x)
+    //   * 5th order polynomial: a * x^5 + b * x^4 + c * x^3 + d * x^2 + e * x + f
+    // So, you can set the model to an exponential, a sum of expontials,
+    // or a polynomial up to 5th order
+    // First argument to setModel is the model type { EXPS, POLY5 }
+    // e.g. double a = .., b = .., c = .., d = .., e = .., f = ..;
+    //      ir.setModel(EXPS, a, b, c, d);  // sum of exponentials
+    // or   ir.setModel(EXPS, a, b);  // exponential
+    // or   ir.setModel(POLY5, a, b, c, d, e, f);  // 5th order polynomial
+    // or   ir.setModel(POLY5, 0, 0, c, d, e, f);  // 3rd order polynomial
+}
+
+void loop()
+{
+    double distance = ir.getCM();  // Gets a distance in cm
+    double duty_cycle = ir.getRaw() / 1023.;  // Defines a ratio
+
+    // Writes distance on the serial port
+    Serial.print(distance);
+    Serial.println("cm");
+
+    // Blinks the onboard LED
+    digitalWrite(LED, HIGH);
+    delay((int)(duty_cycle * 300));
+    digitalWrite(LED, LOW);
+    delay((int)((1-duty_cycle) * 300));
+}
+


WiFlyHQ loopback test

WiFlyHQ loopback test

error: pathspec 'tests/loopback/EchoWiFlyHQ/EchoWiFlyHQ.ino' did not match any file(s) known to git

--- tests/loopback/EchoWiFlyHQ/EchoWiFlyHQ.ino
+++ tests/loopback/EchoWiFlyHQ/EchoWiFlyHQ.ino
@@ -0,0 +1,79 @@
+#include <WiFlyHQ.h>
+
+#define WLAN_SSID       "ssid"
+#define WLAN_PASS       "pass"
+#define SerialWiFly     Serial1
+
+//#include <SoftwareSerial.h>
+//SoftwareSerial SerialWiFly(2, 3);
+
+const char* host = "192.168.0.104";
+uint16_t port = 8888;
+
+WiFly wifly;
+
+void setup(void)
+{
+  Serial.begin(115200);
+  delay(10);
+  SerialWiFly.begin(9600);
+  if (!wifly.begin(&SerialWiFly, &Serial)) {
+    Serial.println("Failed to start wifly");
+  }
+
+  /* Join wifi network if not already associated */
+  if (!wifly.isAssociated()) {
+      /* Setup the WiFly to connect to a wifi network */
+      Serial.println("Joining network");
+      wifly.setSSID(WLAN_SSID);
+      wifly.setPassphrase(WLAN_PASS);
+      wifly.enableDHCP();
+    if (wifly.join()) {
+        Serial.println("Joined wifi network");
+    } else {
+        Serial.println("Failed to join wifi network");
+    }
+  } else {
+      Serial.println("Already in network");
+  }
+
+  if (wifly.isConnected()) {
+      Serial.println("Old connection active. Closing");
+    wifly.close();
+  }
+}
+
+void draw(char c, int qty = 1) {
+  static int col = 0;
+  while (qty-- > 0) {
+    Serial.print(c);
+    col = (col + 1) % 80;
+    if (!col) {
+      Serial.println();
+    }
+  }
+}
+
+void loop(void)
+{
+  delay(5000);
+  Serial.print("Connecting...");
+
+  if (wifly.open(host, port)) {
+    Serial.println(F("Connected."));
+    /* Echo incoming data */
+    while (wifly.isConnected()) {
+      byte buf[128];
+      int qty = wifly.available();
+      if (qty) {
+        qty = wifly.readBytes(buf, qty);
+        qty = wifly.write((const uint8_t*)buf, qty);
+        draw('.');
+      }
+    }
+  } else {
+    Serial.println(F("Connection failed"));
+  }
+  wifly.close();
+}
+


standard animation course and variable start/stop points

error: pathspec 'Arduino/random_color_ease_144/random_color_ease_144.ino' did not match any file(s) known to git

--- Arduino/random_color_ease_144/random_color_ease_144.ino
+++ Arduino/random_color_ease_144/random_color_ease_144.ino
@@ -0,0 +1,537 @@
+// try: dim at ends per cosine, bump into each other and transfer momentum
+
+#include <PololuLedStrip.h>
+#include <math.h>
+
+// Create an ledStrip object and specify the pin it will use.
+PololuLedStrip<12> ledStrip;
+
+#define EASE_EXPONENT 3 // cubic
+#define EASE_COUNT 72
+#define EASE_DELAY 5
+#define EASE_ANIM_MARGIN 30
+
+// Create a buffer for holding the colors (3 bytes per color).
+#define ANIM_LED_COUNT 144
+#define LED_COUNT (ANIM_LED_COUNT + EASE_ANIM_MARGIN)
+#define VLED_COUNT (LED_COUNT)
+#define MAX_LED (LED_COUNT)
+#define MAX_VLED (VLED_COUNT)
+#define LED_COUNT_MIDPOINT (LED_COUNT / 2)
+
+rgb_color colors[LED_COUNT];
+unsigned char existence[VLED_COUNT];
+
+float ease[LED_COUNT];
+
+#define DELAY 1000
+#define FADE_RATE 0.75
+#define FADE_COUNT 20
+
+#define BRIGHTNESS_PERCENT 25
+#define BRIGHTNESS_DIVISOR 20.0
+#define MIN_BRIGHTNESS 1.0
+
+#define RESOLUTION 1000000.0
+
+#define MIN_SPEED 0.50
+#define MAX_SPEED 0.75
+#define SPEED MIN_SPEED
+
+#define NUM_ROWS 10
+#define NUM_COLS 17
+#define MAX_ROW (NUM_ROWS - 1)
+#define MAX_COL (NUM_COLS - 1)
+
+rgb_color black = {0, 0, 0};
+rgb_color gray = {10, 10, 10};
+rgb_color white = {20, 20, 20};
+rgb_color red = {20, 0, 0};
+rgb_color orange = {20, 10, 0};
+rgb_color yellow = {20, 20, 0};
+rgb_color ltgreen = {10, 20, 0};
+rgb_color green = {0, 20, 0};
+rgb_color seafoam = {0, 20, 10};
+rgb_color cyan = {0, 20, 20};
+rgb_color ltblue = {0, 10, 20};
+rgb_color blue = {0, 0, 20};
+rgb_color purple = {10, 0, 20};
+rgb_color magenta = {20, 0, 20};
+rgb_color pink = {20, 0, 10};
+
+#define NPALETTE 6
+#define NPRETTY_COLORS 13
+rgb_color palette[NPALETTE] = { red, orange, yellow, green, blue, purple }; //, cyan, magenta, grue, eurg,  egnaro, rurple, white, gray, black };
+//rgb_color palette[NPALETTE] = { red, green, blue, orange, yellow, purple, cyan, magenta, grue, eurg,  egnaro, rurple, white, gray, black };
+//rgb_color palette[NPALETTE] = { pink, blue, orange, seafoam, white, magenta, ltblue, ltgreen,  purple, red, green, yellow, cyan, gray, black };
+//rgb_color palette[NPALETTE] = { red, orange, pink, magenta,      yellow, green, seafoam, ltgreen,       ltblue, cyan, blue, purple,        white };
+
+#define NGROUPS 3
+#define GROUP_RED_START 0
+#define GROUP_RED_MAX 4
+#define GROUP_GREEN_START 4
+#define GROUP_GREEN_MAX 8
+#define GROUP_BLUE_START 8
+#define GROUP_BLUE_MAX 12
+#define GROUP_WHITE_START 12
+#define GROUP_WHITE_MAX 13
+
+int group_start[4] = {GROUP_RED_START,GROUP_GREEN_START,GROUP_BLUE_START,GROUP_WHITE_START};
+int group_max[4] = {GROUP_RED_MAX,GROUP_GREEN_MAX,GROUP_BLUE_MAX,GROUP_WHITE_MAX};
+
+rgb_color adjusted_palette[NPALETTE];
+
+// 72 @ 2.0
+int sin223_translation[223] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 53, 54, 54, 55, 55, 56, 56, 56, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 64, 64, 65, 65, 65, 66, 66, 66, 66, 67, 67, 67, 67, 67, 68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, 70, 70, 70, 70, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71};
+
+// 72 @ 5.0
+// int sin557_translation[557] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45, 45, 46, 46, 46, 46, 46, 47, 47, 47, 47, 47, 48, 48, 48, 48, 48, 49, 49, 49, 49, 49, 49, 50, 50, 50, 50, 50, 51, 51, 51, 51, 51, 51, 52, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 54, 54, 54, 54, 54, 54, 55, 55, 55, 55, 55, 55, 56, 56, 56, 56, 56, 56, 57, 57, 57, 57, 57, 57, 58, 58, 58, 58, 58, 58, 58, 59, 59, 59, 59, 59, 59, 59, 60, 60, 60, 60, 60, 60, 61, 61, 61, 61, 61, 61, 61, 61, 62, 62, 62, 62, 62, 62, 62, 63, 63, 63, 63, 63, 63, 63, 63, 64, 64, 64, 64, 64, 64, 64, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71};
+
+// 64 @ 2.0
+// int sin198_translation[198] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 49, 50, 50, 51, 51, 51, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60, 60, 60, 61, 61, 61, 61, 61, 61, 62, 62, 62, 62, 62, 62, 62, 62, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63};
+
+#define WARPED sin223_translation
+
+
+#define NUM_OBJECTS 6
+
+//#define MIN_PERIOD 50
+//#define MAX_PERIOD 100
+
+#define WIDTH 3
+
+#define DECAY 0.0
+
+unsigned char bitmask[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
+
+rgb_color scale_color(rgb_color color, float scale){
+  return (rgb_color){
+    ((color.red / BRIGHTNESS_DIVISOR) * 255) * scale,
+    ((color.green / BRIGHTNESS_DIVISOR) * 255) * scale,
+    ((color.blue / BRIGHTNESS_DIVISOR) *255) * scale
+  };
+}
+
+void set_brightness(int brightness_percent = BRIGHTNESS_PERCENT){
+  float percent = brightness_percent / 100.0;
+  for(int i = 0; i < NPALETTE; i++){
+    adjusted_palette[i] = scale_color(palette[i], percent);
+  }
+}
+
+void flood(rgb_color color){
+  for(int i = 0; i < LED_COUNT; i++){
+    colors[i] = color;
+  }
+}
+
+void erase(){
+  flood(black);
+}
+
+void fade(float rate = FADE_RATE){
+  unsigned char *p;
+  p = (unsigned char *)colors;
+  for(int i = 0; i < LED_COUNT * 3; i++){
+    *(p + i) *= rate;
+  }
+}
+
+void fade_fast(){
+  unsigned char *p;
+  p = (unsigned char *)colors;
+  for(int i = 0; i < LED_COUNT * 3; i++){
+    *(p + i) = *(p + i) >> 1;
+  }
+}
+
+void fade_fast2(int rate = FADE_RATE){
+  unsigned char *p;
+  p = (unsigned char *)colors;
+  for(int i = 0; i < LED_COUNT * 3; i++){
+    *(p + i) = max(0, *(p + i) - rate);
+  }
+}
+
+float random_dir(){
+  float result = ((random(RESOLUTION) / RESOLUTION) * (MAX_SPEED - MIN_SPEED)) + MIN_SPEED;
+
+  result = random(2) == 1 ? result : result * -1.0;
+
+  return result;
+
+  //int range = random(RESOLUTION - MIN_SPEED) + MIN_SPEED;
+  //return (range / (RESOLUTION * 1.0)) - 0.5;
+}
+
+int random_color(){
+  return random(NPRETTY_COLORS);
+}
+
+int reflect_i(int *i, int *d, int mx, int mn = 0){
+  int ld = *d;
+  int next = *i + *d;
+  if(next > mx || next < mn){
+    *d *= -1;
+  }
+  *i += *d;
+
+  int dir = 0;
+  if(*d > ld){
+    dir = 1;
+  } else if(*d < ld){
+    dir = -1;
+  }
+  return dir;
+}
+
+bool position_occupied(int pos, int id){
+  return (existence[pos] & ~bitmask[id]) == 0 ? false : true;
+}
+
+float reflect_f(float *f, float *d, int id, float mx = 1.0, float mn = 0.0){
+  float ld = *d;
+  float last = *f;
+  float next = *f + *d;
+
+//  int lasti = WARPAGE[int(last)];
+//  int nexti = WARPAGE[int(next)];
+  int lasti = int(last);
+  int nexti = int(next);
+
+//  bool clash = (nexti != lasti) && position_occupied(nexti, id);
+  bool clash =  position_occupied(nexti, id);
+
+  if(next > mx || next < mn || clash){
+    *d *= -1.0;
+  }
+  *f += *d;
+
+  int dir = 0;
+  if(*d > ld){
+    dir = 1;
+  } else if(*d < ld){
+    dir = -1;
+  }
+  return dir;
+}
+
+int wrap_i(int i, int d, int mx){
+  int next = i + d;
+  if(next >= mx){
+    return 0;
+  } else {
+    return next;
+  }
+}
+
+float wrap_f(float f, float d, float mx = 1.0){
+  float next = f + d;
+  if(next >= mx){
+    return 0.0;
+  } else {
+    return next;
+  }
+}
+
+rgb_color add_color(rgb_color color1, rgb_color color2){
+  rgb_color new_color;
+  new_color.red = min(255, color1.red + color2.red);
+  new_color.green = min(255, color1.green + color2.green);
+  new_color.blue = min(255, color1.blue + color2.blue);
+  return new_color;
+}
+
+rgb_color subtract_color(rgb_color color1, rgb_color color2){
+  rgb_color new_color;
+  new_color.red = max(0, color1.red - color2.red);
+  new_color.green = max(0, color1.green - color2.green);
+  new_color.blue = max(0, color1.blue - color2.blue);
+  return new_color;
+}
+
+//swaps red & green, needed on led strands, not on strips
+void setup_colors(bool swap = true){
+  if(swap == true){
+    for(int i = 0; i < NPALETTE; i++){
+      unsigned char value = palette[i].red;
+      palette[i].red = palette[i].green;
+      palette[i].green = value;
+    }
+  }
+  memcpy(adjusted_palette, palette, sizeof(palette));
+}
+
+void setup()
+{
+  randomSeed(analogRead(0));
+  setup_colors(false);
+  set_brightness();
+
+  for(int i = 0; i < VLED_COUNT; i++){
+     existence[i] = 0;
+  }
+
+  set_brightness(BRIGHTNESS_PERCENT);
+
+  generate_shift_ease(EASE_COUNT, EASE_EXPONENT);
+}
+
+/*
+#define MAX_BRIGHTNESS 20.0
+#define BRIGHTNESS_STEP 2.0
+*/
+
+void poof(int color, int times=10, int brightness=50){
+  set_brightness(brightness);
+  for(int i = 0; i < times; i++){
+    flood(black);
+    ledStrip.write(colors, LED_COUNT);
+    delay(33);
+    flood(adjusted_palette[color]);
+    ledStrip.write(colors, LED_COUNT);
+    delay(33);
+  }
+
+  flood(black);
+  ledStrip.write(colors, LED_COUNT);
+  delay(33);
+}
+
+/*
+void draw(rgb_color color, int pos, int num = 1){
+  int side = num / 2;
+  int left = max(0, pos - side);
+  int right = min(LED_COUNT - 1, pos + side);
+
+  for(int i = left; i <= right; i++){
+    colors[i] = add_color(colors[i], color);
+  }
+}
+*/
+
+void draw(rgb_color color, int pos, int id = 0){
+  if(pos < 0 || pos >= LED_COUNT) return;
+  //int warped = WARPED[pos];
+  colors[pos] = add_color(colors[pos], color);
+  existence[pos] |= bitmask[id];
+}
+
+void undraw(rgb_color color, int pos, int id = 0){
+  if(pos < 0 || pos >= LED_COUNT) return;
+  //int warped = WARPED[pos];
+  //colors[warped] = subtract_color(colors[warped], color);
+  existence[pos] &= ~bitmask[id];
+}
+
+float decay(float value){
+  float orig = value;
+  if(value >= 0){
+    value -= DECAY;
+    if(value < 0){
+      value = random_dir();
+    }
+  } else {
+    value += DECAY;
+    if(value > 0){
+      value = random_dir();
+    }
+  }
+  return value;
+}
+
+float ease_power_in(float percent, int power){
+  return pow(percent, power);
+}
+
+float ease_power_out(float percent, int power){
+  return 1 - pow(1 - percent, power);
+}
+
+float ease_elastic_out(float percent){
+  return sin(-13 * M_PI_2 * (percent + 1)) * pow(2, -10 * percent) + 1;
+}
+// elastic in: return sin(13 * M_PI_2 * p) * pow(2, 10 * (p - 1));
+
+void generate_power_ease(int count, int power){
+  float midpoint = count / 2;
+  for(int i = 0; i < midpoint; i++){
+    float percent = i / midpoint;
+    ease[i] = 0.5 * (ease_power_in(percent, power));
+    ease[i + int(midpoint)] = (0.5 * (ease_power_out(percent, power))) + 0.5;
+  }
+}
+
+// power ease in then elastic ease out
+void generate_shift_ease(int count, int power){
+  float midpoint = count / 2;
+  for(int i = 0; i < midpoint; i++){
+    float percent = i / midpoint;
+    ease[i] = 0.5 * (ease_power_in(percent, power));
+    ease[i + int(midpoint)] = (0.5 * (ease_elastic_out(percent))) + 0.5;
+  }
+}
+
+void flush(){
+  ledStrip.write(colors, LED_COUNT);
+}
+
+#define MIN_SIZE 4
+
+void loop()
+{
+//  int anim_delay = 10;
+
+//  int maxx = 0;
+  while(true){
+    for(int e = 0; e < NPALETTE; e++){
+      int anim_space = random(ANIM_LED_COUNT);
+      int anim_start = random(0, anim_space - MIN_SIZE);
+      int anim_width = anim_space - anim_start;
+
+      for(int i = 0; i < EASE_COUNT; i++){
+        fade_fast();
+        int x = ease[i] * anim_width;
+//        draw(white, anim_space - 1);
+        draw(adjusted_palette[e],  x + anim_start);
+//          if(x > maxx) maxx = x;
+//        draw(pink, maxx + 1);
+//        draw(cyan, LED_COUNT - 1);
+        flush();
+        delay(EASE_DELAY);
+      }
+
+//      for(int i = 0; i < FADE_COUNT; i++){
+//        fade_fast();
+//        draw(white, ANIM_LED_COUNT-1);
+//        flush();
+//        delay(EASE_DELAY);
+//      }
+//
+//      erase();
+
+//      for(int i = EASE_COUNT - 1; i >= 0; i--){
+//        fade_fast();
+//        int x = ease[i] * (LED_COUNT - ANIM_MARGIN);
+//        if(x >= 0 && x < LED_COUNT){
+//          draw(adjusted_palette[e],  x);
+//        }
+//        flush();
+//        delay(EASE_DELAY);
+//      }
+
+      delay(DELAY);
+    }
+  }
+  return;
+
+  float x[NUM_OBJECTS];
+  float dx[NUM_OBJECTS];
+  int lx[NUM_OBJECTS];
+  int group[NUM_OBJECTS];
+  int period[NUM_OBJECTS];
+  int count[NUM_OBJECTS];
+  bool state[NUM_OBJECTS];
+  // int change[NUM_OBJECTS];
+  rgb_color show_color[NUM_OBJECTS];
+
+//  int choices[NGROUPS];
+//  for(int i = 0; i < NGROUPS; i++){
+//    choices[i] = -1;
+//  }
+
+/*
+  for(int i = 0; i < NGROUPS; i++){
+    while(true){
+      int color = random(NGROUPS);
+
+      bool try_again = false;
+      for(int j = 0; j < i; j++){
+        if(color == choices[j]){
+          try_again = true;
+          break;
+        }
+      }
+      if(try_again == true){
+        continue;
+      }
+
+      choices[i] = color;
+      break;
+    }
+  }
+*/
+  for(int i = 0; i < NUM_OBJECTS; i++){
+    x[i] = i * (VLED_COUNT / NUM_OBJECTS);
+    dx[i] = random_dir();
+//    dx[i] = 1.0;
+    lx[i] = -1;
+//    period[i] = random(MIN_PERIOD, MAX_PERIOD);
+//    count[i] = period[i];
+//    state[i] = false;
+  }
+
+  rgb_color random_colors[NUM_OBJECTS];
+  for(int i = 0; i < NUM_OBJECTS; i++){
+//    group[i] = choices[i % NGROUPS];
+//    random_colors[i] = adjusted_palette[random(group_start[group[i]], group_max[group[i]])];
+    random_colors[i] = adjusted_palette[i];
+//    show_color[i] = random_colors[i];
+  }
+
+  while(true){
+    //fade();
+    //erase();
+    fade_fast();
+    //fade_fast2();
+
+    for(int i = 0; i < NUM_OBJECTS; i++){
+      //change[i] =
+      reflect_f(&x[i], &dx[i], i, MAX_VLED);
+
+      //dx[i] = decay(dx[i]);
+
+//      int tpos = WARPAGE[int(x[i])];
+      int tpos = int(x[i]);
+//      if(tpos != lx[i]){
+        undraw(random_colors[i], lx[i], i);
+        draw(random_colors[i], tpos, i);
+        lx[i] = tpos;
+//      }
+
+//      if(lx != x[i]){
+//        int lpos = sin223_translation[int(lx)];
+//      }
+    }
+
+/*
+    for(int i = 0; i < NUM_OBJECTS; i++){
+      if(change[i] == 0){
+        if(position_occupied(int(x[i]), i)){
+          dx[i] *= -1.0;
+        }
+      }
+    }
+*/
+
+    ledStrip.write(colors, LED_COUNT);
+    delay(DELAY);
+  }
+
+
+}
+
+int low_limit(int value, int limit){
+  return value < limit ? limit : value;
+}
+
+int high_limit(int value, int limit){
+  return value > limit ? limit : value;
+}
+
+int keep_in(int value, int lower, int upper){
+  return low_limit(high_limit(value, upper), lower);
+}
+
+
+


Now using Receiver logic for data transmission. Need voltage level shifter for the project to work fully. IR Controller uses 5V

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/irfansehic/web_based_rgb_controller.git/'


modfied the example from miguelbalboa/rfid

https://github.com/miguelbalboa/rfid/blob/master/examples/AccessControl/AccessControl.ino

error: pathspec 'src/main.ino' did not match any file(s) known to git

--- src/main.ino
+++ src/main.ino
@@ -0,0 +1,261 @@
+#include <EEPROM.h>
+#include <SPI.h>
+#include <MFRC522.h>
+
+constexpr uint8_t relay = 12;
+
+boolean match = false;
+boolean programMode = false;
+boolean replaceMaster = false;
+
+uint8_t successRead;
+
+byte storedCard[4];
+byte readCard[4];
+byte masterCard[4];
+
+constexpr uint8_t RST_PIN = 9;
+constexpr uint8_t SS_PIN = 10;
+
+MFRC522 mfrc522(SS_PIN, RST_PIN);
+
+void setup() {
+  pinMode(relay, OUTPUT);
+  digitalWrite(relay, LOW);
+
+  Serial.begin(9600);
+  SPI.begin();
+
+  mfrc522.PCD_Init();
+  mfrc522.PCD_SetAntennaGain(mfrc522.RxGain_max);
+
+  Serial.println(F("SESAME"));
+  Serial.println("");
+
+  byte v = mfrc522.PCD_ReadRegister(mfrc522.VersionReg);
+
+  if ((v == 0x00) || (v == 0xFF)) {
+    Serial.println(F("Communication with MFRC522 has failed."));
+
+    while(true);
+  }
+
+  if (EEPROM.read(1) != 143) {
+    Serial.println(F("Define a master card by scanning one now."));
+
+    do {
+      successRead = getID();
+    } while (!successRead);
+
+    for (uint8_t j = 0; j < 4; j++) {
+      EEPROM.write(2 + j, readCard[j]);
+    }
+
+    EEPROM.write(1, 143);
+
+    Serial.println(F("Succesfully defined the master card."));
+    Serial.println("");
+  }
+
+  for (uint8_t i = 0; i < 4; i++) {
+    masterCard[i] = EEPROM.read(2 + i);
+  }
+
+  Serial.println(F("Ready to bounce!"));
+  Serial.println("");
+}
+
+void loop() {
+  do {
+    successRead = getID();
+  } while (!successRead);
+
+  if (programMode) {
+    if (isMaster(readCard)) {
+      programMode = false;
+
+      Serial.println(F("Master card scanned."));
+      Serial.println(F("Exiting program mode."));
+      Serial.println("");
+    } else {
+      if (findID(readCard)) {
+        Serial.println(F("I know this PICC, removing..."));
+        deleteID(readCard);
+        Serial.println(F("Scan a PICC to ADD or REMOVE to EEPROM"));
+
+        return;
+      }
+
+      Serial.println(F("I do not know this PICC, adding..."));
+      writeID(readCard);
+      Serial.println(F("Scan a PICC to ADD or REMOVE to EEPROM"));
+    }
+  } else {
+    if (isMaster(readCard)) {
+      programMode = true;
+      Serial.println(F("Hello Master - Entered Program Mode"));
+      uint8_t count = EEPROM.read(0);
+      Serial.print(F("I have "));
+      Serial.print(count);
+      Serial.print(F(" record(s) on EEPROM"));
+      Serial.println("");
+      Serial.println(F("Scan a PICC to ADD or REMOVE to EEPROM"));
+      Serial.println(F("Scan Master Card again to Exit Program Mode"));
+
+      return;
+    }
+
+    if (findID(readCard)) {
+      Serial.println(F("Welcome! Open sesame!"));
+      granted();
+      return;
+    }
+
+    Serial.println(F("You shall not pass"));
+    denied();
+  }
+}
+
+void granted() {
+  digitalWrite(relay, HIGH);
+  delay(500);
+  digitalWrite(relay, LOW);
+  delay(1000);
+}
+
+void denied() {
+  delay(1000);
+}
+
+uint8_t getID() {
+  if (!mfrc522.PICC_IsNewCardPresent()) {
+    return 0;
+  }
+
+  if (!mfrc522.PICC_ReadCardSerial()) {
+    return 0;
+  }
+
+  Serial.println(F("Scanned PICC's UID:"));
+
+  for (uint8_t i = 0; i < 4; i++) {
+    readCard[i] = mfrc522.uid.uidByte[i];
+    Serial.print(readCard[i], HEX);
+  }
+
+  Serial.println("");
+  mfrc522.PICC_HaltA();
+
+  return 1;
+}
+
+void readID(uint8_t number) {
+  uint8_t start = (number * 4 ) + 2;
+
+  for (uint8_t i = 0; i < 4; i++) {
+    storedCard[i] = EEPROM.read(start + i);
+  }
+}
+
+void writeID(byte a[]) {
+  if (findID(a)) {
+    Serial.println(F("Failed! There is something wrong with ID or bad EEPROM"));
+
+    return;
+  }
+
+  uint8_t num = EEPROM.read(0);
+  uint8_t start = (num * 4) + 6;
+  num++;
+  EEPROM.write(0, num);
+
+  for (uint8_t j = 0; j < 4; j++) {
+    EEPROM.write(start + j, a[j]);
+  }
+
+  Serial.println(F("Succesfully added ID record to EEPROM"));
+}
+
+void deleteID(byte a[]) {
+  if (!findID(a)) {
+    Serial.println(F("Failed! There is something wrong with ID or bad EEPROM"));
+
+    return;
+  }
+
+  uint8_t num = EEPROM.read(0);
+  uint8_t slot;
+  uint8_t start;
+  uint8_t looping;
+  uint8_t j;
+  uint8_t count = EEPROM.read(0);
+  slot = findIDSLOT(a);
+  start = (slot * 4) + 2;
+  looping = ((num - slot) * 4);
+  num--;
+  EEPROM.write(0, num);
+
+  for (j = 0; j < looping; j++) {
+    EEPROM.write( start + j, EEPROM.read(start + 4 + j));
+  }
+
+  for (uint8_t k = 0; k < 4; k++) {
+    EEPROM.write(start + j + k, 0);
+  }
+
+  Serial.println(F("Succesfully removed ID record from EEPROM"));
+}
+
+boolean checkTwo(byte a[], byte b[]) {
+  if ( a[0] != 0 ) {
+    match = true;
+  }
+
+  for (uint8_t k = 0; k < 4; k++) {
+    if (a[k] != b[k]) {
+      match = false;
+
+      break;
+    }
+  }
+
+  if (match) {
+    return true;
+  }
+
+  return false;
+}
+
+uint8_t findIDSLOT(byte find[]) {
+  uint8_t count = EEPROM.read(0);
+
+  for (uint8_t i = 1; i <= count; i++) {
+    readID(i);
+
+    if (checkTwo(find, storedCard)) {
+      return i;
+    }
+  }
+}
+
+boolean findID(byte find[]) {
+  uint8_t count = EEPROM.read(0);
+
+  for (uint8_t i = 1; i <= count; i++) {
+    readID(i);
+
+    if (checkTwo(find, storedCard)) {
+      return true;
+    }
+  }
+
+  return false;
+}
+
+boolean isMaster(byte test[]) {
+  if (checkTwo(test, masterCard)) {
+    return true;
+  }
+
+  return false;
+}


The infrastructure to enlightenment

The infrastructure to enlightenment

error: pathspec 'Cabins/tryouts/InfraRed_to_Led_V1/InfraRed_to_Led_V1.ino' did not match any file(s) known to git

--- Cabins/tryouts/InfraRed_to_Led_V1/InfraRed_to_Led_V1.ino
+++ Cabins/tryouts/InfraRed_to_Led_V1/InfraRed_to_Led_V1.ino
@@ -0,0 +1,40 @@
+#include <Adafruit_NeoPixel.h>
+#define PIN 6
+
+
+Adafruit_NeoPixel strip = Adafruit_NeoPixel(6, PIN, NEO_GRB + NEO_KHZ800);
+
+// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across
+// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input
+// and minimize distance between Arduino and first pixel.  Avoid connecting
+// on a live circuit...if you must, connect GND first.
+
+byte ledPositions[3][2] = {
+  {0, 5},
+  {1, 4},
+  {2, 3},
+};
+
+void setup() {
+  Serial.begin(115200);
+  strip.begin();
+  strip.show(); // Initialize all pixels to 'off'
+}
+
+void loop() {
+
+  Serial.println(analogRead(0)); //0-1023
+  int j = analogRead(0) / 4;
+
+  for (int i = 0; i < 3; i++) {
+    strip.setPixelColor(ledPositions[i][0], strip.Color(0, j, 0)); /*fellheid liniaire toename*/
+  }
+
+  for (int i = 0; i < 3; i++) {
+    strip.setPixelColor(ledPositions[i][1], strip.Color(0, 0, j * j / 256));/* fellheid exponentiele toename (wordt opgevat als liniaire toename)*/
+  }
+  strip.show();
+  delay(10);
+
+}
+


Create esc_test.ino

Create esc_test.ino

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/GaParmar/quadcopter.git/'


mpu demo

mpu demo

error: pathspec 'testing/arduino/MPU6050.ino' did not match any file(s) known to git

--- testing/arduino/MPU6050.ino
+++ testing/arduino/MPU6050.ino
@@ -0,0 +1,280 @@
+// I2C device class (I2Cdev) demonstration Arduino sketch for MPU6050 class using DMP (MotionApps v2.0)
+// 6/21/2012 by Jeff Rowberg <jeff@rowberg.net>
+// Updates should (hopefully) always be available at https://github.com/jrowberg/i2cdevlib
+//
+// Changelog:
+//      2013-05-08 - added seamless Fastwire support
+//                 - added note about gyro calibration
+//      2012-06-21 - added note about Arduino 1.0.1 + Leonardo compatibility error
+//      2012-06-20 - improved FIFO overflow handling and simplified read process
+//      2012-06-19 - completely rearranged DMP initialization code and simplification
+//      2012-06-13 - pull gyro and accel data from FIFO packet instead of reading directly
+//      2012-06-09 - fix broken FIFO read sequence and change interrupt detection to RISING
+//      2012-06-05 - add gravity-compensated initial reference frame acceleration output
+//                 - add 3D math helper file to DMP6 example sketch
+//                 - add Euler output and Yaw/Pitch/Roll output formats
+//      2012-06-04 - remove accel offset clearing for better results (thanks Sungon Lee)
+//      2012-06-01 - fixed gyro sensitivity to be 2000 deg/sec instead of 250
+//      2012-05-30 - basic DMP initialization working
+
+/* ============================================
+I2Cdev device library code is placed under the MIT license
+Copyright (c) 2012 Jeff Rowberg
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+===============================================
+*/
+
+// I2Cdev and MPU6050 must be installed as libraries, or else the .cpp/.h files
+// for both classes must be in the include path of your project
+#include "I2Cdev.h"
+
+#include "MPU6050_6Axis_MotionApps20.h"
+//#include "MPU6050.h" // not necessary if using MotionApps include file
+
+// Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation
+// is used in I2Cdev.h
+#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
+    #include "Wire.h"
+#endif
+
+// class default I2C address is 0x68
+// specific I2C addresses may be passed as a parameter here
+// AD0 low = 0x68 (default for SparkFun breakout and InvenSense evaluation board)
+// AD0 high = 0x69
+MPU6050 mpu;
+//MPU6050 mpu(0x69); // <-- use for AD0 high
+
+/* =========================================================================
+   NOTE: In addition to connection 3.3v, GND, SDA, and SCL, this sketch
+   depends on the MPU-6050's INT pin being connected to the Arduino's
+   external interrupt #0 pin. On the Arduino Uno and Mega 2560, this is
+   digital I/O pin 2.
+ * ========================================================================= */
+
+/* =========================================================================
+   NOTE: Arduino v1.0.1 with the Leonardo board generates a compile error
+   when using Serial.write(buf, len). The Teapot output uses this method.
+   The solution requires a modification to the Arduino USBAPI.h file, which
+   is fortunately simple, but annoying. This will be fixed in the next IDE
+   release. For more info, see these links:
+
+   http://arduino.cc/forum/index.php/topic,109987.0.html
+   http://code.google.com/p/arduino/issues/detail?id=958
+ * ========================================================================= */
+
+
+#define INTERRUPT_PIN 2  // use pin 2 on Arduino Uno & most boards
+#define LED_PIN 13 // (Arduino is 13, Teensy is 11, Teensy++ is 6)
+bool blinkState = false;
+
+// MPU control/status vars
+bool dmpReady = false;  // set true if DMP init was successful
+uint8_t mpuIntStatus;   // holds actual interrupt status byte from MPU
+uint8_t devStatus;      // return status after each device operation (0 = success, !0 = error)
+uint16_t packetSize;    // expected DMP packet size (default is 42 bytes)
+uint16_t fifoCount;     // count of all bytes currently in FIFO
+uint8_t fifoBuffer[64]; // FIFO storage buffer
+
+// orientation/motion vars
+Quaternion q;           // [w, x, y, z]         quaternion container
+VectorInt16 aa;         // [x, y, z]            accel sensor measurements
+VectorInt16 aaReal;     // [x, y, z]            gravity-free accel sensor measurements
+VectorInt16 aaWorld;    // [x, y, z]            world-frame accel sensor measurements
+VectorFloat gravity;    // [x, y, z]            gravity vector
+float euler[3];         // [psi, theta, phi]    Euler angle container
+float ypr[3];           // [yaw, pitch, roll]   yaw/pitch/roll container and gravity vector
+
+// packet structure for InvenSense teapot demo
+uint8_t teapotPacket[28] = { '$', 0x03, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0x00, 0x00, '\r', '\n' };
+
+
+
+// ================================================================
+// ===               INTERRUPT DETECTION ROUTINE                ===
+// ================================================================
+
+volatile bool mpuInterrupt = false;     // indicates whether MPU interrupt pin has gone high
+void dmpDataReady() {
+    mpuInterrupt = true;
+}
+
+
+
+// ================================================================
+// ===                      INITIAL SETUP                       ===
+// ================================================================
+
+void setup() {
+    // join I2C bus (I2Cdev library doesn't do this automatically)
+    #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
+        Wire.begin();
+        Wire.setClock(400000); // 400kHz I2C clock. Comment this line if having compilation difficulties
+    #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE
+        Fastwire::setup(400, true);
+    #endif
+
+    // initialize serial communication
+    // (115200 chosen because it is required for Teapot Demo output, but it's
+    // really up to you depending on your project)
+    Serial.begin(115200);
+    while (!Serial); // wait for Leonardo enumeration, others continue immediately
+
+    // NOTE: 8MHz or slower host processors, like the Teensy @ 3.3v or Ardunio
+    // Pro Mini running at 3.3v, cannot handle this baud rate reliably due to
+    // the baud timing being too misaligned with processor ticks. You must use
+    // 38400 or slower in these cases, or use some kind of external separate
+    // crystal solution for the UART timer.
+
+    // initialize device
+    Serial.println(F("Initializing I2C devices..."));
+    mpu.initialize();
+    pinMode(INTERRUPT_PIN, INPUT);
+
+    // verify connection
+    Serial.println(F("Testing device connections..."));
+    Serial.println(mpu.testConnection() ? F("MPU6050 connection successful") : F("MPU6050 connection failed"));
+
+    // load and configure the DMP
+    Serial.println(F("Initializing DMP..."));
+    devStatus = mpu.dmpInitialize();
+
+    // supply your own gyro offsets here, scaled for min sensitivity
+    mpu.setXAccelOffset(-1169);
+    mpu.setYAccelOffset(744);
+    mpu.setZAccelOffset(1620);
+    mpu.setXGyroOffset(48);
+    mpu.setYGyroOffset(47);
+    mpu.setZGyroOffset(-8);
+
+    // make sure it worked (returns 0 if so)
+    if (devStatus == 0) {
+        // turn on the DMP, now that it's ready
+        Serial.println(F("Enabling DMP..."));
+        mpu.setDMPEnabled(true);
+
+        // enable Arduino interrupt detection
+        Serial.println(F("Enabling interrupt detection (Arduino external interrupt 0)..."));
+        attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN), dmpDataReady, RISING);
+        mpuIntStatus = mpu.getIntStatus();
+
+        // set our DMP Ready flag so the main loop() function knows it's okay to use it
+        Serial.println(F("DMP ready! Waiting for first interrupt..."));
+        dmpReady = true;
+
+        // get expected DMP packet size for later comparison
+        packetSize = mpu.dmpGetFIFOPacketSize();
+    } else {
+        // ERROR!
+        // 1 = initial memory load failed
+        // 2 = DMP configuration updates failed
+        // (if it's going to break, usually the code will be 1)
+        Serial.print(F("DMP Initialization failed (code "));
+        Serial.print(devStatus);
+        Serial.println(F(")"));
+    }
+
+    // configure LED for output
+    pinMode(LED_PIN, OUTPUT);
+}
+
+
+
+// ================================================================
+// ===                    MAIN PROGRAM LOOP                     ===
+// ================================================================
+
+void loop() {
+    // if programming failed, don't try to do anything
+    if (!dmpReady) return;
+
+    // wait for MPU interrupt or extra packet(s) available
+    while (!mpuInterrupt && fifoCount < packetSize) {
+        // other program behavior stuff here
+        // .
+        // .
+        // .
+        // if you are really paranoid you can frequently test in between other
+        // stuff to see if mpuInterrupt is true, and if so, "break;" from the
+        // while() loop to immediately process the MPU data
+        // .
+        // .
+        // .
+    }
+
+    // reset interrupt flag and get INT_STATUS byte
+    mpuInterrupt = false;
+    mpuIntStatus = mpu.getIntStatus();
+
+    // get current FIFO count
+    fifoCount = mpu.getFIFOCount();
+
+    // check for overflow (this should never happen unless our code is too inefficient)
+    if ((mpuIntStatus & 0x10) || fifoCount == 1024) {
+        // reset so we can continue cleanly
+        mpu.resetFIFO();
+        Serial.println(F("FIFO overflow!"));
+
+    // otherwise, check for DMP data ready interrupt (this should happen frequently)
+    } else if (mpuIntStatus & 0x02) {
+        // wait for correct available data length, should be a VERY short wait
+        while (fifoCount < packetSize) fifoCount = mpu.getFIFOCount();
+
+        // read a packet from FIFO
+        mpu.getFIFOBytes(fifoBuffer, packetSize);
+
+        // track FIFO count here in case there is > 1 packet available
+        // (this lets us immediately read more without waiting for an interrupt)
+        fifoCount -= packetSize;
+
+        // display quaternion values in InvenSense Teapot demo format:
+        teapotPacket[2] = fifoBuffer[0];
+        teapotPacket[3] = fifoBuffer[1];
+        teapotPacket[4] = fifoBuffer[4];
+        teapotPacket[5] = fifoBuffer[5];
+        teapotPacket[6] = fifoBuffer[8];
+        teapotPacket[7] = fifoBuffer[9];
+        teapotPacket[8] = fifoBuffer[12];
+        teapotPacket[9] = fifoBuffer[13];
+        // gyro values
+        teapotPacket[10] = fifoBuffer[16];
+        teapotPacket[11] = fifoBuffer[17];
+        teapotPacket[12] = fifoBuffer[20];
+        teapotPacket[13] = fifoBuffer[21];
+        teapotPacket[14] = fifoBuffer[24];
+        teapotPacket[15] = fifoBuffer[25];
+        // accelerometer values
+        teapotPacket[16] = fifoBuffer[28];
+        teapotPacket[17] = fifoBuffer[29];
+        teapotPacket[18] = fifoBuffer[32];
+        teapotPacket[19] = fifoBuffer[33];
+        teapotPacket[20] = fifoBuffer[36];
+        teapotPacket[21] = fifoBuffer[37];
+        //temperature
+        int16_t temperature = mpu.getTemperature();
+        teapotPacket[22] = temperature >> 8;
+        teapotPacket[23] = temperature & 0xFF;
+        Serial.write(teapotPacket, 28);
+        teapotPacket[25]++; // packetCount, loops at 0xFF on purpose
+
+        // blink LED to indicate activity
+        blinkState = !blinkState;
+        digitalWrite(LED_PIN, blinkState);
+    }
+}


Fixes writing of bytes to the serial stream.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/bassjansson/vera.git/'


+ Initial commit

+ Initial commit

--- toolpass.ino
+++ toolpass.ino
@@ -0,0 +1,9 @@
+void setup() {
+  // put your setup code here, to run once:
+
+}
+
+void loop() {
+  // put your main code here, to run repeatedly:
+
+}


V1 of the arduino code to listen on serial and control the lights.

error: pathspec 'arduino/thunder/thunder.ino' did not match any file(s) known to git

--- arduino/thunder/thunder.ino
+++ arduino/thunder/thunder.ino
@@ -0,0 +1,40 @@
+#include <Adafruit_NeoPixel.h>
+
+#define NUM_LEDS 300
+#define PIN 7
+#define WHITE 255,255,255
+
+Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);
+
+int lighting_style = 0;
+int intensity = 0;
+uint8_t index = 0;
+
+void setup() {
+    Serial.begin(9600);
+    strip.begin();
+    strip.show();
+}
+
+void loop() {
+    if (Serial.available() > 1) {
+      lighting_style = Serial.read();
+      intensity = Serial.read();
+
+      if(index=0){
+        index = random(NUM_LEDS);
+      }
+
+      strip.setPixelColor(index, strip.Color(WHITE));
+      strip.setBrightness(intensity);
+      strip.show();
+
+
+      Serial.print("Index: ");
+      Serial.print(index);
+      Serial.print("  Intensity:");
+      Serial.println(intensity);
+
+
+    }
+}


New directory structure

New directory structure

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/labfab/vitrines-io.git/'


Inital Code Commit

Inital Code Commit

This is the first commit of the Garden Project's code. This gives an
outline of the project's goals and also is intended run on an Arduino
Uno.

error: pathspec 'Automated_Garden_Arduino.ino' did not match any file(s) known to git

--- Automated_Garden_Arduino.ino
+++ Automated_Garden_Arduino.ino
@@ -0,0 +1,508 @@
+/*************************************************************************************
+*   Project:      Automated Garden Monitor
+*   Author:       Oliver Salmeron
+*   Date Began:   May, 2016
+*
+*   Description:  This program monitors and controls the parameters of a garden space.
+*                 All inputs and outputs are modular by design and can be selected as desired.
+*
+*   Hardware Hook Up:
+*     - Indicator LED
+*       -- Digital Pin 2 -> 1k Resistor -> LED -> GND (Series)
+*       -- LED: Positive Lead is the longer lead
+*     - DHT11 Humidity and Temperature Sensor
+*       -- 3.3V               -   pin 1
+*       -- GND                -   pin 4
+*       -- Digital Pin 3      -   pin 2
+*     - Soil Moisture Sensor
+*       -- 3.3V               -   Red Wire
+*       -- GND                -   Black Wire
+*       -- Analog Pin 0       -   Green Wire
+*     - Photocell
+*       -- 3.3V               -   Either End
+*       -- Analog Pin 1       -   Opposite End + 5kOhm Pull Down Resistor (to GND)
+*     - Digital Temperature Sensor
+*       -- ??
+*     - Water Flow Sensor
+*       -- 5V Power Source    -   Red Wire
+*       -- Digital Pin 4      -   Yellow Wire
+*       -- GND                -   Black Wire
+*     - Water Solenoid Valve
+*       -- Digital Pin 5      -   Transistor: 12V -> Both Terminals
+*
+*   Wireless Communication:
+*     - Bluetooth (Feather)
+*       -- Eddystone URL:   https://freeboard.io/board/Rqzu2j
+*       -- Description:     The bluetooth nRF51 chip broadcasts the link above to any nearby devices. This website is where all the information is displayed visually.
+*     - WiFi (HUZZAH)
+*       -- IP Address:
+*       -- SSID:
+*       -- Password:
+*
+*   Steps:
+*     1. Get Parts
+*     2. Set Up sensors individually
+*     3. Set Up sensors under 1 code
+*     4. Enclose
+*     5. Make a projected Business Plan
+*       - Executive Summary
+*         -- Expected Revenues, Expenses, Profits (5 years)
+*         -- Funding needed
+*       - Company Overview
+*       - Industry Analysis
+*         -- Market Overview
+*         -- Relevant Market Size
+*       - Customer Analysis
+*         -- Target Customers
+*         -- Customer Needs
+*       - Competitive Analysis
+*         -- Direct Competitors
+*         -- Indirect Competitors
+*         -- Competitive Advantages
+*       - Marketing Plan
+*         -- Products & Services
+*         -- Pricing
+*         -- Promotions Plan
+*         -- Distributions Plan
+*       - Price of Production
+*       - Price of Retail
+*       -
+*
+*
+*   Psuedoinstructions:
+*   - Inputs (Settings and Sensors)
+*       Config/Settings   <-- Presets or User "Recipes"
+*                               Defines the Parameters (# of plants, strains, area)
+*                               Controls the Outputs and Automation
+*       Documentation     <-- Create a new portfolio or Select an existing one
+*         | Portfolio Name:       Name                    |
+*         | Strain/Plant Name:    Name                    |
+*         | Setting:              Name                    |
+*         | # of plants:          1                       |
+*         | Sensors Connected:    4/5                     |
+*         |   Humidity        -- ok                       |
+*         |   Temperature     -- ok                       |
+*         |   Soil Moisture   -- ok                       |
+*         |   Light Intensity -- ok                       |
+*         |   Water Flow      -- error, not connected     |
+*         | Sensor Data:          Saved to SD card        |
+*         |   Humidity        -- %                        |
+*         |   Temperature     -- Fahrenheit               |
+*         |   Heat Index      -- Fahrenheit               |
+*         |   Soil Moisture   -- ?                        |
+*         |   Light Intensity -- lux                      |
+*         |   Water Flow      -- lps                      |
+*         |   Water Used      -- Liters or Gallons        |
+*         |   Water Tank      -- Liters or Gallons        |
+*         | Picture:              Timelapse               |
+*         | Graphs:               Select Timeframe        |
+*         |   Past 24 Hours                               |
+*         |   Past 2 Weeks                                |
+*         |   Past Month                                  |
+*         |   Full Length                                 |
+*       Sensors           <-- Modular and Wireless
+*         | Humidity          -- DHT11 Humidity & Temp Sensor              |
+*         | Temperature       -- DHT11 Humidity & Temp Sensor              |
+*         |                      Amazon Digital Temp Sensor                |
+*         | Soil Moisture     -- Sparkfun Soil Moisture Sensor             |
+*         | Lights            -- Photocell Diode                           |
+*         | Water Flow        -- Adafruit Water Flow Sensor                |
+*         | Camera            -- FLIR, Webcam                              |
+*         | Display Interface -- Joystick, Button and Text                 |
+*         | Water pH          -- eTape Chemical Sensor (Need to purchase)  |
+*         | Soil pH           -- (Need to Purchase)                        |
+*         | pH Level          -- (Need to purchase)                        |
+*         | Nutrients         -- (Need to purchase)                        |
+*         |                      Foliar Feeding or Injection to Water line |
+*
+*   - Outputs (Controls and Displays)
+*       Automation        <-- Defined in the Settings
+*         | 1. Light Cycle and Intensity Controls
+*         |     LED's           -- Light & Temperature Sensors  |
+*         | 2. Fan Controls                                     |
+*         |     Computer Fan    -- Humidity & Temperature       |
+*         | 3. Water Controls                                   |
+*         |     Solenoid Valve  -- Soil Moisture                |
+*         | 5. [Nutrient Controls]                              |
+*         | 6. [pH Controls]                                    |
+*       Micro OLED        <-- [System Information]
+*         | Internet Connection:  Yes (If No, info is saved on SD)                  |
+*         | Datalogging:          Yes                                               |
+*         | Plant Groups:         5                                                 |
+*         |   1. Cannabis                                                           |
+*         |   2. Succulents                                                         |
+*         |   3. Jalapenos/ Veggies                                                 |
+*         |   4. Herbs                                                              |
+*         |   5. Houseplants                                                        |
+*         | Group 1:              Name (each plant/section has a unique Portfolio)  |
+*         | Strain:               Name                                              |
+*         | Settings:             Preset 1/ mySettings 1                            |
+*         | # of plants:          1                                                 |
+*         | Sensors Connected:    4/5 (display errors if any)                       |
+*         |   Humidity        -   ok                                                |
+*         |   Temperature     -   ok                                                |
+*         |   Soil Moisture   -   ok                                                |
+*         |   Light Intensity -   ok                                                |
+*         |   Water Flow      -   error, not connected                              |
+*         | Sensor Data:          Averaged over 30 second intervals                 |
+*         |   Humidity        -   %                                                 |
+*         |   Temperature     -   Fahrenheit & Heat Index                           |
+*         |   Soil Moisture   -                                                     |
+*         |   Light Intensity -   lux                                               |
+*         |   Water Flow      -   lps                                               |
+*       Wireless Hardware <-- Any IoT hardware used in the project
+*         | Bluetooth chip:   Connects the Modular Devices, broadcast Website Link  |
+*         | WiFi chip:        Connects the System with the Internet                 |
+*       Wireless Software <-- Any IoT software used in the project
+*         | Dweet.io          - https://dweet.io/
+*         | Freeboard.io      - https://freeboard.io/board/Rqzu2j
+*         | Sparkfun Phant    - https://learn.sparkfun.com/tutorials/pushing-data-to-datasparkfuncom/what-is-phant
+*
+*       Data Logs         <-- Each Plant/Group has a Portfolio
+*         | 1. Plant/Strain Name                                |
+*         | 2. Log # (auto check for last log)                  |
+*         | 3. Date                                             |
+*         | 4. Setting Name                                     |
+*         | 5. Picture                                          |
+*         | 6. Data (last 24 hrs, 1 month, beggining of time)   |
+*         | 7. Notes                                            |
+*
+*******************************************************************
+*  To-do:  Add User Input for initial setup Configuration
+*          Add Inputs (Sensors and Settings)
+*            - Digital Temp sensor (from amazon)
+*            - [Nutrients Portfolio]
+*            - [Connect 5 led level display for each sensor (7x = 35 leds)]
+*              -- Average range of values
+*          Add Outputs (Controls, Communications and Displays)
+*            - Light Controls
+*              -- Linked with Light Intensity and settings
+*              -- Add if/else statements to integrate light schedule
+*              -- Preset Cycle Settings
+*            - Fan Controls
+*              -- Linked with Humidity and Temp
+*              -- Add if/else statements to integrate fan schedule
+*              -- Preset Ideal Heat Index (humidity & temp) Settings
+*            - Water Controls
+*              -- Linked with Soil Moisture
+*              -- Add if/else statements to integrate watering schedule
+*              -- Preset Ideal Water Thresholds Settings
+*              -- Adjust for soil
+*            - [Nutrient Controls]
+*              -- Linked with [Nutrient Sensor]
+*              -- Preset Strain Nutrient Recipes
+*            - Communication (BLE)
+*              -- Sensor Data Transmission
+*              -- API
+*              -- GUI
+*            - Graphs and Displays
+*              -- Light Intensity vs Time
+*              -- Humidity, Temp, Fan Cycles vs Time
+*              -- Soil Moisture vs Time
+*              -- Average range of values
+*          Update entire code to Feather M0, SAMD21 support
+*
+*
+*       MIT license, check LICENSE for more information
+*       All text above, and the splash screen below must be included in
+*       any redistribution
+*********************************************************************/
+
+/*********************************************************************
+* void setup() {
+*   // Initialize Input Sensors
+*     // Camera
+*     // Temperature (Digital Temp)
+*     // Humidity (Digital)
+*     // Soil Moisture (Analog)
+*
+*     // Light Sensor (Analog)
+*     // Water Level Sensor ()
+*     // pH Sensor (Digital)
+* }
+*
+* void loop() {
+*   // Read Sensors
+*   // Display Sensor Readings (Micro OLED)
+*   // Transmit Sensor Readings (Bluetooth)
+*   // Output Controls
+*     // Light Controls
+*     // Water Controls
+*     // Fan Controls
+* }
+*********************************************************************/
+
+
+#include <Arduino.h>
+#include <SPI.h>
+#if not defined (_VARIANT_ARDUINO_DUE_X_) && not defined (_VARIANT_ARDUINO_ZERO_)
+  #include <SoftwareSerial.h>
+#endif
+
+#include <Wire.h>                       // Adafruit I2C Library
+#include <Adafruit_Sensor.h>            // Adafruit Sensor Library
+
+#include "DHT.h"                        // DHT11 Sensor Library
+
+// Adafruit Bluefruit Libraries
+#include "Adafruit_BLE.h"               // Adafruit Bluetooth Library
+#include "Adafruit_BluefruitLE_SPI.h"   // Adafruit Bluefruit I2C Definition
+#include "Adafruit_BluefruitLE_UART.h"  // Adafruit Bluefruit UART Definition
+
+
+#include "BluefruitConfig.h"            // Adafruit Bluefruit Config file
+
+
+// DEFINITIONS
+// DHT11 Humidity and Temperature Sensor Definitions
+#define DHTPIN 2          // what digital pin we're connected to
+#define DHTTYPE DHT11     // DHT 11 type
+
+DHT dht(DHTPIN, DHTTYPE); // Initialize DHT sensor.
+
+// DHT11 pinout
+// Connect pin 1 (on the left) of the sensor to +5V
+// NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1
+// to 3.3V instead of 5V!
+// Connect pin 2 of the sensor to whatever your DHTPIN is
+// Connect pin 4 (on the right) of the sensor to GROUND
+// Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor
+
+// Soil Moisture Sensor Definitions
+int sensorPin1 = A0;      // sensorPin1 <-- Soil Moisture (Analog pin A0)
+
+int thresholdUp = 400;    // High threshold that is used in the Water Cycle
+int thresholdDown = 250;  // Low threshold that is used in the Water Cycle
+
+// Photocell Light Intensity Definitions
+int photocellPin = 1;     // the cell and 10K pulldown are connected to a1
+int photocellReading;     // the analog reading from the sensor divider
+
+// LED Definitions
+int LEDpin = 3;           // connect Red LED to Digital pin 3 (PWM pin)
+int LEDbrightness;        // Used when controlling brightness
+
+// Water Flow Sensor Definitions
+#define FLOWSENSORPIN 4  // Digital Pin 4 <-- Flow Sensor
+
+// count how many pulses!
+volatile uint16_t pulses = 0;
+// track the state of the pulse pin
+volatile uint8_t lastflowpinstate;
+// you can try to keep time of how long it is between pulses
+volatile uint32_t lastflowratetimer = 0;
+// and use that to calculate a flow rate
+volatile float flowrate;
+// Interrupt is called once a millisecond, looks for any pulses from the sensor!
+SIGNAL(TIMER0_COMPA_vect) {
+  uint8_t x = digitalRead(FLOWSENSORPIN);
+
+  if (x == lastflowpinstate) {
+    lastflowratetimer++;
+    return; // nothing changed!
+  }
+
+  if (x == HIGH) {
+    //low to high transition!
+    pulses++;
+  }
+  lastflowpinstate = x;
+  flowrate = 1000.0;
+  flowrate /= lastflowratetimer;  // in hertz
+  lastflowratetimer = 0;
+}
+
+// Create useInterrupt function tool for Water Flow Sensor
+void useInterrupt(boolean v) {
+  if (v) {
+    // Timer0 is already used for millis() - we'll just interrupt somewhere
+    // in the middle and call the "Compare A" function above
+    OCR0A = 0xAF;
+    TIMSK0 |= _BV(OCIE0A);
+  } else {
+    // do not call the interrupt function COMPA anymore
+    TIMSK0 &= ~_BV(OCIE0A);
+  }
+}
+
+
+void setup(void)
+{
+  while (!Serial);          // required for Flora & Micro
+  delay(500);               // Wait 0.5 sec before checking again
+
+  Serial.begin(115200);     // Set the Baud Rate
+  // System Information
+  Serial.println(F("Automated Garden Code"));
+  Serial.println(F("------------------------------------"));
+  delay(500);               // wait for display to boot up
+
+/*
+  pinMode(FLOWSENSORPIN, INPUT);                  // Define digital pin 4 as input
+  digitalWrite(FLOWSENSORPIN, HIGH);              // Set digital pin 4 to high
+  lastflowpinstate = digitalRead(FLOWSENSORPIN);  // Set the read digital value to lastflowpinstate
+  useInterrupt(true);
+
+  dht.begin();
+*/
+}
+
+void loop(void)
+{
+
+  // Wait a few seconds between measurements.
+  delay(2000);
+  // Add the reading # and timestamp to each reading measured
+
+  /////////////////////////////////////////////////////////////////////
+  // Reading # and Timestamp loop
+  /////////////////////////////////////////////////////////////////////
+  // Add the reading # and timestamp to each measurement recorded
+  int reading;
+  int i;
+  String timestamp;
+  String ts;
+
+  timestamp = ("May 3, 2015 ");
+  ts = timestamp;
+
+  i = 1;
+  reading = reading + i;
+
+  Serial.print(reading);
+  Serial.print("\t");
+  Serial.println(ts);
+
+  /////////////////////////////////////////////////////////////////////
+  // Soil Moisture Sensor loop
+  /////////////////////////////////////////////////////////////////////
+  // Define sensorValue as the pin's analog value.
+  int sensorValue1;
+  sensorValue1 = analogRead(sensorPin1);
+
+  // Print the Soil Moisture Level info.
+  Serial.print("Soil Moisture Level: ");
+  Serial.print(sensorValue1);
+  Serial.print("\t");
+
+  /////////////////////////////////////////////////////////////////////
+  // Photocell Light Intensity loop
+  /////////////////////////////////////////////////////////////////////
+  photocellReading = analogRead(photocellPin);
+
+  // Print the raw analog light intensity value
+  Serial.print("| Analog light reading: ");
+  Serial.print(photocellReading);     // the raw analog reading
+  // We'll have a few threshholds, qualitatively determined
+  if (photocellReading < 10) {
+    Serial.println(" - Dark");
+  } else if (photocellReading < 200) {
+    Serial.println(" - Dim");
+  } else if (photocellReading < 500) {
+    Serial.println(" - Light");
+  } else if (photocellReading < 800) {
+    Serial.println(" - Bright");
+  } else {
+    Serial.println(" - Very bright");
+  }
+  Serial.println("\t| ");
+  // Convert to Lux
+  // ??????????????
+/*  // Control the brightness of an LED in response to photocell
+  // LED gets brighter the darker it is at the sensor
+  // that means we have to -invert- the reading from 0-1023 back to 1023-0
+  photocellReading = 1023 - photocellReading;
+  //now we have to map 0-1023 to 0-255 since thats the range analogWrite uses
+  LEDbrightness = map(photocellReading, 0, 1023, 0, 255);
+  analogWrite(LEDpin, LEDbrightness);
+*/
+
+  /////////////////////////////////////////////////////////////////////
+  // DHT11 Humidity and Temperature loop
+  /////////////////////////////////////////////////////////////////////
+  // Reading temperature or humidity takes about 250 milliseconds!
+  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
+  float h = dht.readHumidity();
+  // Read temperature as Celsius (the default)
+  float t = dht.readTemperature();
+  // Read temperature as Fahrenheit (isFahrenheit = true)
+  float f = dht.readTemperature(true);
+
+  // Check if any reads failed and exit early (to try again).
+  if (isnan(h) || isnan(t) || isnan(f)) {
+    Serial.println("Failed to read from DHT sensor!");
+    return;
+  }
+
+  // Compute heat index in Fahrenheit (the default)
+  float hif = dht.computeHeatIndex(f, h);
+  // Compute heat index in Celsius (isFahreheit = false)
+  float hic = dht.computeHeatIndex(t, h, false);
+
+  // Print Humidity/Temp Info
+  Serial.print("Humidity: ");
+  Serial.print(h);
+  Serial.print(" %\t");
+  Serial.print("| Temperature: ");
+  Serial.print(t);
+  Serial.print(" *C ");
+  Serial.print(f);
+  Serial.print(" *F");
+  Serial.print("| Heat index: ");
+  Serial.print(hic);
+  Serial.print(" *C ");
+  Serial.print(hif);
+  Serial.println(" *F");
+
+  /////////////////////////////////////////////////////////////////////
+  // Water Flow sensor loop
+  /////////////////////////////////////////////////////////////////////
+  // Print Water Flow sensor info
+  Serial.print("Freq: "); Serial.print(flowrate); Serial.print(" \t\t");
+  Serial.print("| Pulses: "); Serial.print(pulses, DEC); Serial.print(" \t\t\t");
+
+  // if a plastic sensor use the following calculation
+  // Sensor Frequency (Hz) = 7.5 * Q (Liters/min)
+  // Liters = Q * time elapsed (seconds) / 60 (seconds/minute)
+  // Liters = (Frequency (Pulses/second) / 7.5) * time elapsed (seconds) / 60
+  // Liters = Pulses / (7.5 * 60)
+  float liters = pulses;
+  liters /= 7.5;
+  liters /= 60.0;
+
+  // Print the amount of liquid passed in liters
+  Serial.print("| Liters: "); Serial.println(liters);
+
+  /////////////////////////////////////////////////////////////////////
+  // Light Intensity sensor loop
+  /////////////////////////////////////////////////////////////////////
+
+  /////////////////////////////////////////////////////////////////////
+  // Water Resevoir Level sensor loop
+  /////////////////////////////////////////////////////////////////////
+
+}
+
+/**************************************************************************/
+/*!
+    @brief  Checks for user input (via the Serial Monitor)
+*/
+/**************************************************************************/
+void getUserInput(char buffer[], uint8_t maxSize)
+{
+  memset(buffer, 0, maxSize);
+  while( Serial.available() == 0 ) {
+    delay(1);
+  }
+
+  uint8_t count=0;
+
+  do
+  {
+    count += Serial.readBytes(buffer+count, maxSize);
+    delay(2);
+  } while( (count < maxSize) && !(Serial.available() == 0) );
+
+
+
+}


Optimise data types

Optimise data types

fatal: remote error: upload-pack: not our ref 88eec26429562611d2a174d34a9e4e5e756ac808
fatal: the remote end hung up unexpectedly


Fix Serial1 being imported instead of Serial

error: pathspec 'Data' did not match any file(s) known to git
error: pathspec 'Logging/Data-Logging-Main/Data-Logging-Main.ino' did not match any file(s) known to git