Fix typo in a Ethernet Shield example

Fix typo in a Ethernet Shield 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/bsmr-arduino/Arduino.git/'


test information led

test information led

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/Hinaka/-FPT-CAPSTONE-PGSS.git/'


Update src.ino

Update src.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/AJama50/CS207-Project.git/'


Add Arduino code

Add Arduino code

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

--- src/Arduino_Toggl.ino
+++ src/Arduino_Toggl.ino
@@ -0,0 +1,55 @@
+#include <LiquidCrystal.h>
+
+LiquidCrystal lcd(4, 3, 14, 15, 16, 17);
+int maxCharacterPerLine = 16;
+int nodataCount = 0;
+
+void setup() {
+  // LCD initialize
+  lcd.begin(16, 2);
+  lcd.clear();
+  lcd.setCursor(maxCharacterPerLine - 9,0);
+  lcd.print("Toggl.com");
+  lcd.setCursor(maxCharacterPerLine - 12,1);
+  lcd.print("Time Checker");
+
+  // Serial initialize
+  Serial.begin(9600);
+  delay(5000) ;
+}
+
+void loop() {
+  int count = 0;
+
+  // Check data received
+  if(Serial.available() > 0){
+    lcd.setCursor(0, 0);
+    nodataCount = 0;
+  }
+  else if(nodataCount < 6){
+    nodataCount++;
+  }
+  else{
+    lcd.clear();
+    lcd.setCursor(maxCharacterPerLine - 16,0);
+    lcd.print("No data received");
+    lcd.setCursor(maxCharacterPerLine - 10,1);
+    lcd.print("Waiting...");
+  }
+
+  // Write data to LCD
+  while (Serial.available()) {
+    // Line Break
+    if(count == maxCharacterPerLine * 2){
+      lcd.setCursor(0,0);
+    }
+    else if(count == maxCharacterPerLine){
+      lcd.setCursor(0,1);
+    }
+    lcd.write(Serial.read());
+    count++;
+  }
+
+  delay(1000);
+}
+


Adding a simple 2.4 GHz channel detect tool.

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

--- examples/Tools/CosaRF24scanner/CosaRF24scanner.ino
+++ examples/Tools/CosaRF24scanner/CosaRF24scanner.ino
@@ -0,0 +1,131 @@
+/**
+ * @file CosaRF24scanner.ino
+ * @version 1.0
+ *
+ * @section License
+ * Copyright (C) 2014, Mikael Patel
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * @section Description
+ * Cosa 2.4 GHz Scanner using the NRF24L01P device driver.
+ *
+ * @section Acknowledgement
+ * This tool is inspired by the Nrf24L01-Poor Man's 2.4 GHz Scanner.
+ * http://arduino-info.wikispaces.com/Nrf24L01-Poor+Man%27s+2.4+GHz+Scanner
+ *
+ * This file is part of the Arduino Che Cosa project.
+ */
+
+#include "Cosa/RTC.hh"
+#include "Cosa/Watchdog.hh"
+#include "Cosa/Wireless/Driver/NRF24L01P.hh"
+#include "Cosa/IOStream/Driver/UART.hh"
+#include "Cosa/Trace.hh"
+
+/**
+ * Extend the NRF24L01P device driver with measurement and plot of
+ * received power detect. For more details see ch. 6.3 and 6.4.
+ *
+ * @section References
+ * nRF24L01+ Product Specification (Rev. 1.0),
+ * http://www.nordicsemi.com/kor/nordic/download_resource/8765/2/17776224
+ */
+class RF24scanner : public NRF24L01P {
+public:
+  /** Number of channels scanned; 2 MHz bandwidth */
+  static const uint8_t CHANNEL_MAX = 64;
+
+  /**
+   * Construct the 2.4 GHz channel scanner.
+   */
+  RF24scanner() : NRF24L01P(0xC05A, 0x11) {}
+
+  /**
+   * Measure the received power for all channels for the given
+   * number of samples per channel.
+   * @param[in] samples per channel (default 200).
+   */
+  void measure(uint16_t samples = 200);
+
+  /**
+   * Plot the number of received power detect per channel to the
+   * given output stream. The print out is channel frequency,
+   * NRF24L01 channel number, WiFi channel number and samples
+   * as a bar.
+   * @param[in] outs output stream.
+   */
+  void plot(IOStream& outs);
+
+protected:
+  static const uint16_t WAIT_TIME = 130 + 40 + 30;
+  uint8_t m_channel[CHANNEL_MAX];
+};
+
+void
+RF24scanner::measure(uint16_t samples)
+{
+  if (samples == 0) return;
+
+  // Clear the receive power detect counters and configure as receiver
+  memset(m_channel, 0, sizeof(m_channel));
+  write(CONFIG, (_BV(EN_CRC) | _BV(CRCO) | _BV(PWR_UP) | _BV(PRIM_RX)));
+
+  do {
+    // Set channel and check the receiver power detect register
+    for (uint8_t i = 0; i < CHANNEL_MAX; i++) {
+      write(RF_CH, i * 2);
+      m_ce.set();
+      DELAY(WAIT_TIME);
+      m_channel[i] += (read(RPD) != 0);
+      m_ce.clear();
+      }
+  } while (--samples);
+}
+
+void
+RF24scanner::plot(IOStream& outs)
+{
+  // Plot the measurements with channel frequency and number (wifi)
+  trace << PSTR("--------------------") << endl;
+  for (uint8_t i = 0; i < CHANNEL_MAX; i++) {
+    if (m_channel[i] != 0) {
+      float freq = 2.4 + 0.002 * i;
+      outs << freq << ':' << 2 * i << ':';
+      if (freq < 2.412 || freq > 2.472)
+	outs << PSTR("-:");
+      else
+	outs << (int) ((freq - 2.412) * 200.0) + 1 << ':';
+      for (uint8_t j = 0; j < m_channel[i]; j++)
+	outs << 'I';
+      outs << endl;
+    }
+  }
+}
+
+// Scanner with the default pin configuration
+RF24scanner scanner;
+
+void setup()
+{
+  uart.begin(9600);
+  trace.begin(&uart, PSTR("CosaRF24scanner: started"));
+  trace << PSTR("channel frequency:number:wifi:detects") << endl;
+  Watchdog::begin();
+  RTC::begin();
+  ASSERT(scanner.begin());
+}
+
+void loop()
+{
+  scanner.measure();
+  scanner.plot(trace);
+}


Created the arduino program for parsing the json

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

--- json_arduino.ino
+++ json_arduino.ino
@@ -0,0 +1,234 @@
+#include <Adafruit_NeoPixel.h>
+#include <ESP8266WiFi.h>
+#include <WiFiClient.h>
+#include <ArduinoJson.h>
+
+#ifdef __AVR__
+  #include <avr/power.h>
+#endif
+
+/**
+ * The number lights in your led strip
+ */
+#define NUMPIXELS      60
+
+/**
+ * The default time before request another pattern.  It's in milliseconds so it would be 10 seconds
+ */
+int intervalToCheckTime = 10000;
+
+/**
+ *  The time in the future to check the web for a new pattern.  We set it to zero, it will be set correctly in the web request
+ */
+int checkTimeInNumberOfSeconds = 0;
+
+// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.
+// Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest
+// example for more information on possible values.
+Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, D6, NEO_GRB + NEO_KHZ800);
+
+WiFiClient client;
+
+/**
+ *  WIFI STUFF
+ */
+const char* ssid = "****";//type your ssid
+const char* password = "****";//type your password
+const char* host = "arduino-christmas-lighting-nglaser.c9users.io";
+const uint16_t port = 80;
+
+
+
+/**
+ * The number represents the max frame / lights a pattern can affect
+ */
+const int MAX_FRAMES = 250;
+
+/**
+ * This represents a frame.
+ */
+struct RGB_LIGHT {
+  int red;
+  int green;
+  int blue;
+  int lightPosition;
+  int delayTime;
+  /**
+   * If skip is true we break
+   */
+  boolean skip;
+};
+
+/**
+ * The pattern / frames used to turn on and off the lights
+ */
+RGB_LIGHT lights[MAX_FRAMES];
+
+void setup() {
+  // This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
+#if defined (__AVR_ATtiny85__)
+  if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
+#endif
+  // End of trinket special code
+
+  pixels.begin(); // This initializes the NeoPixel library.
+  Serial.begin(115200);
+  delay(10);
+
+  // We start by connecting to a WiFi network
+
+  Serial.println();
+  Serial.println();
+  Serial.print("Connecting to ");
+  Serial.println(ssid);
+
+  /* Explicitly set the ESP8266 to be a WiFi-client, otherwise, it by default,
+     would try to act as both a client and an access-point and could cause
+     network-issues with your other WiFi-devices on your WiFi-network. */
+  WiFi.mode(WIFI_STA);
+  WiFi.begin(ssid, password);
+
+  while (WiFi.status() != WL_CONNECTED) {
+    delay(500);
+    Serial.print(".");
+  }
+
+  Serial.println("");
+  Serial.println("WiFi connected");
+  Serial.println("IP address: ");
+  Serial.println(WiFi.localIP());
+
+  clearLights();
+  webRequest();
+  checkTimeInNumberOfSeconds = millis() + intervalToCheckTime;
+
+}
+
+void loop() {
+
+  if (checkTimeInNumberOfSeconds > millis()) {
+     for(int frameNumbers=0; frameNumbers < MAX_FRAMES; frameNumbers++){
+        if (lights[frameNumbers].skip == false) {
+            pixels.setPixelColor(lights[frameNumbers].lightPosition, pixels.Color(lights[frameNumbers].red,lights[frameNumbers].green,lights[frameNumbers].blue));
+            pixels.show();
+            delay(lights[frameNumbers].delayTime);
+        }
+        else {
+           break;
+        }
+    }
+  }
+  else {
+       webRequest();
+       Serial.println("NEW PATTERN");
+       // Sets the time to check the web for a new pattern
+       checkTimeInNumberOfSeconds = millis() + intervalToCheckTime;
+  }
+}
+
+/**
+ * Clears all the lights
+ */
+void clearLights() {
+      for (int i = 0; i < NUMPIXELS; i += 1) {
+         pixels.setPixelColor(i, pixels.Color(0,0,0));
+         pixels.show();
+      }
+}
+
+/**
+ *  Clears the array of RGB_LIGHTS
+ */
+void clearArrayOfLights() {
+  for(int i=0; i < MAX_FRAMES; i++){
+      lights[i] = {0,0,0, 0, 0,false};
+  }
+}
+
+/**
+ * Makes the web request to get the light pattern
+ */
+void webRequest() {
+    String jsonString = "";
+    if (client.connect(host, port)) {
+          String url =  "/leds";
+          client.println("GET " + url + " HTTP/1.1");
+          client.println("Host: "+ (String)host);
+          client.println("User-Agent: Arduino/1.0");
+          client.println("Connection: close");
+          client.println();
+          client.println();
+          while (client.connected()) {
+
+            client.readStringUntil('|');
+            jsonString = client.readStringUntil('\n');
+
+          }
+          parseJSONFromServer(jsonString);
+    }
+    else {
+      Serial.println("NOT CONNECTED");
+    }
+}
+
+
+/**
+ *  Parses the json string
+ */
+void parseJSONFromServer(String jsonString)
+{
+     DynamicJsonBuffer  jsonBuffer;
+    // Root of the object tree.
+    //
+    // It's a reference to the JsonObject, the actual bytes are inside the
+    // JsonBuffer with all the other nodes of the object tree.
+    // Memory is freed when jsonBuffer goes out of scope.
+    JsonObject& root = jsonBuffer.parseObject(jsonString);
+
+
+
+    // Test if parsing succeeds.
+    if (!root.success()) {
+      Serial.println("parseObject() failed JSON STRING");
+      Serial.println(jsonString);
+      return;
+    }
+
+  JsonArray& reds = root["reds"].asArray();
+  JsonArray& greens = root["greens"].asArray();
+  JsonArray& blues = root["blues"].asArray();
+  JsonArray& lightPositions = root["lightPositions"].asArray();
+  JsonArray& delayTimes = root["delayTimes"].asArray();
+  intervalToCheckTime = root["requestTime"];
+  clearArrayOfLights();
+  for (int i = 0; i < reds.size(); i += 1) {
+       lights[i] = {
+                reds.get<int>(i),
+                greens.get<int>(i),
+                blues.get<int>(i),
+                lightPositions.get<int>(i),
+                delayTimes.get<int>(i),
+                false
+       };
+  }
+}
+
+
+/**
+ *  A debuggin function for seeing the light pattern
+ */
+void printLights() {
+  Serial.println("LIGHT PATTERN");
+  for (int frameNumbers = 0; frameNumbers < MAX_FRAMES; frameNumbers += 1) {
+         if (lights[frameNumbers].skip) {
+             break;
+         }
+         Serial.print("FRAME  " + String(frameNumbers, 10));
+         Serial.print(" RED " + String(lights[frameNumbers].red, 10));
+         Serial.print(" GREEN " + String(lights[frameNumbers].green, 10));
+         Serial.print(" BLUE " + String(lights[frameNumbers].blue, 10));
+         Serial.print(" LIGHT POSITION " + String(lights[frameNumbers].lightPosition, 10));
+         Serial.print(" DELAY TIME " + String(lights[frameNumbers].delayTime, 10));
+         Serial.println();
+  }
+}


Finished all crucial functions

Finished all crucial functions

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/MichalMares/Ardularm.git/'


add the actual controller code

add the actual controller code

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

--- Sensorium/Sensorium.ino
+++ Sensorium/Sensorium.ino
@@ -0,0 +1,420 @@
+// Sensorium - Kiwiburn 2014 art installation.
+//
+// There are some nasty hacks in this code due to time constraints and weekend of
+// trying to get something working before the festival!
+//
+// The set up involves two Teensy 3.1's connected by their SPI pins.
+// One has this code loaded on it, with masterTeensy = true,
+// the other with masterTeensy = false. The master sends updates with
+//
+// - 8 sync bytes of 255,
+// - dial reading
+// - the framecount.
+//
+// Both teensy's read the "big button state" which Kiwiburners could
+// use to turn the sensorium on and off.
+//
+// This could all be done much better, but nothing like a time constraint
+// to force to make something work!
+//
+//
+// Originally modified from:
+// PlazINT  -  Fast Plasma Generator using Integer Math Only
+// Edmund "Skorn" Horn
+// March 4,2013
+// Version 1.0 adapted for OctoWS2811Lib (tested, working...)
+
+
+#include <OctoWS2811.h>
+#include <FastRunningMedian.h>
+
+//OctoWS2811 Defn. Stuff
+//#define COLS_LEDs 60  // all of the following params need to be adjusted for screen size
+//#define ROWS_LEDs 16  // LED_LAYOUT assumed 0 if ROWS_LEDs > 8
+#define LEDS_PER_STRIP 127 //(COLS_LEDs * (ROWS_LEDs / 6))
+#define DEBUG false
+
+DMAMEM int displayMemory[LEDS_PER_STRIP*6];
+int drawingMemory[LEDS_PER_STRIP*6];
+const int config = WS2811_GRB | WS2811_800kHz;
+OctoWS2811 leds(LEDS_PER_STRIP, displayMemory, drawingMemory, config);
+unsigned long frameCount=25500;  // arbitrary seed to calculate the three time displacement variables t,t2,t3
+
+// 1. update LEDS_PER_STRIP
+
+// master
+const int bigButtonAndControlPin = A3;
+const int modeSelectorPin = A4;
+const int masterPin = A5;
+// master teensy reads big button, slave reads commands from control pin.
+boolean masterTeensy = true;
+//boolean masterTeensy = false;
+
+// button to determine display
+#define SHOW_PLASMA 1
+#define INACTIVE 0
+#define BUTTON_THRESHOLD 100
+
+int displayState = INACTIVE; // 0 means nothing displayed
+
+int bigButtonState;        // the current reading from the input pin
+int lastBigButtonState = LOW; // the previous reading from the input pin
+// the following variables are long's because the time, measured in miliseconds,
+// will quickly become a bigger number than can be stored in an int.
+//long lastDebounceTime = 0;  // the last time the output pin was toggled
+//long debounceDelay = 5;    // the debounce time; increase if the output flickers
+
+long lastDialTime = 0;  // the last time the output pin was toggled
+long dialDelay = 500;    // the debounce time; increase if the output flickers
+int dialSpeed = 10;
+
+
+//Byte val 2PI Cosine Wave, offset by 1 PI
+//supports fast trig calcs and smooth LED fading/pulsing.
+uint8_t const cos_wave[256] PROGMEM =
+{0,0,0,0,1,1,1,2,2,3,4,5,6,6,8,9,10,11,12,14,15,17,18,20,22,23,25,27,29,31,33,35,38,40,42,
+45,47,49,52,54,57,60,62,65,68,71,73,76,79,82,85,88,91,94,97,100,103,106,109,113,116,119,
+122,125,128,131,135,138,141,144,147,150,153,156,159,162,165,168,171,174,177,180,183,186,
+189,191,194,197,199,202,204,207,209,212,214,216,218,221,223,225,227,229,231,232,234,236,
+238,239,241,242,243,245,246,247,248,249,250,251,252,252,253,253,254,254,255,255,255,255,
+255,255,255,255,254,254,253,253,252,252,251,250,249,248,247,246,245,243,242,241,239,238,
+236,234,232,231,229,227,225,223,221,218,216,214,212,209,207,204,202,199,197,194,191,189,
+186,183,180,177,174,171,168,165,162,159,156,153,150,147,144,141,138,135,131,128,125,122,
+119,116,113,109,106,103,100,97,94,91,88,85,82,79,76,73,71,68,65,62,60,57,54,52,49,47,45,
+42,40,38,35,33,31,29,27,25,23,22,20,18,17,15,14,12,11,10,9,8,6,6,5,4,3,2,2,1,1,1,0,0,0,0
+};
+
+
+//Gamma Correction Curve
+uint8_t const exp_gamma[256] PROGMEM =
+{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,2,2,2,2,2,2,2,2,2,3,3,3,3,3,
+4,4,4,4,4,5,5,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,9,10,10,10,11,11,12,12,12,13,13,14,14,14,15,15,
+16,16,17,17,18,18,19,19,20,20,21,21,22,23,23,24,24,25,26,26,27,28,28,29,30,30,31,32,32,33,
+34,35,35,36,37,38,39,39,40,41,42,43,44,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
+61,62,63,64,65,66,67,68,70,71,72,73,74,75,77,78,79,80,82,83,84,85,87,89,91,92,93,95,96,98,
+99,100,101,102,105,106,108,109,111,112,114,115,117,118,120,121,123,125,126,128,130,131,133,
+135,136,138,140,142,143,145,147,149,151,152,154,156,158,160,162,164,165,167,169,171,173,175,
+177,179,181,183,185,187,190,192,194,196,198,200,202,204,207,209,211,213,216,218,220,222,225,
+227,229,232,234,236,239,241,244,246,249,251,253,254,255
+};
+
+const int numDialReadings = 4;
+int dialReadings[numDialReadings];      // the readings from the analog input
+int dialIndex = 0;                  // the index of the current reading
+int dialTotal = 0;                  // the running total
+int dialAverage = 0;                // the average
+FastRunningMedian<unsigned int, 5, 50> dialReadingsMedian;
+
+float readDial() {
+  int theValue = analogRead(modeSelectorPin);
+  dialReadingsMedian.addValue(theValue);
+
+  theValue = dialReadingsMedian.getMedian();
+
+  // subtract the last reading:
+  dialTotal = dialTotal - dialReadings[dialIndex];
+  dialReadings[dialIndex] = theValue;
+
+  // add the reading to the total:
+  dialTotal = dialTotal + dialReadings[dialIndex];
+  dialIndex++;
+
+  if (dialIndex >= numDialReadings) dialIndex = 0;
+
+  // calculate the average:
+  dialAverage = dialTotal / numDialReadings;
+  return dialAverage;
+
+}
+
+void setup()
+{
+  delay(100);
+  Serial.begin(38400);
+  Serial.write('\n');
+  Serial.println("---------------------------------");
+  Serial.println("Starting Sensorium, version 1");
+
+  Serial1.begin(9600);
+
+  if (masterTeensy) {
+    Serial.println("Master mode");
+    pinMode(masterPin, OUTPUT);
+    digitalWrite(masterPin, HIGH);
+    // initialize all the readings to 0:
+    for (int thisReading = 0; thisReading < numDialReadings; thisReading++)
+      dialReadings[thisReading] = 0;
+  } else {
+    Serial.println("Slave mode");
+  }
+
+  Serial.println("---------------------------------");
+
+  pinMode(bigButtonAndControlPin, INPUT);
+  pinMode(modeSelectorPin, INPUT);
+
+  pinMode(13, OUTPUT);
+
+  leds.begin();
+  leds.show();
+}
+
+void clearPixels() {
+    for (uint8_t y = 0; y < 8; y++) {
+       for (uint8_t x = 0; x < LEDS_PER_STRIP ; x++) {
+          int pixelIndex = (y * LEDS_PER_STRIP) + x;
+          leds.setPixel(pixelIndex, 0);
+        }
+    }
+}
+
+int circleRows = 19;
+int maxRowLength = 72;
+// format is { teensy led pin, reversed?, num leds }
+const int rowLayout[][3] = {
+  { 0, 0, 36, }, {0, 1, 46},
+  { 1, 0, 51  }, {1, 1, 57},
+  { 2, 0, 60  }, {2, 1, 65},
+  { 3, 0, 69 },
+  { 4, 0, 70 },
+  { 5, 0, 72 },
+  { 6, 0, 72 },
+  { 7, 0, 72 },
+  { 8, 0, 71 },
+  { 9, 0, 68 },
+  { 10, 0, 65 }, {10, 1, 61 },
+  { 11, 0, 56 }, {11, 1, 52 },
+  { 12, 0, 43 }, {12, 1, 38 },
+};
+
+int getPixelIndex(int row, int col) {
+  boolean reverse = false;
+  int offset = 0, offsetRow = 0, actualRow = 0, rowLength = 0, diff = 0, col_offset=0;
+
+  if (row >= circleRows) return -1;
+  rowLength = rowLayout[row][2];
+  col_offset = (maxRowLength - rowLength) / 2;
+  if (col < col_offset || col > maxRowLength - col_offset) return -1;
+
+  actualRow = rowLayout[row][0];
+  reverse = rowLayout[row][1];
+
+
+  offsetRow = row - 1;
+  while(offsetRow >= 0 && rowLayout[offsetRow][0] == actualRow) {
+    offset += rowLayout[offsetRow][2];
+    offsetRow --;
+  }
+
+  if (masterTeensy) { actualRow -= 7; }
+
+  diff = maxRowLength - rowLength;
+
+  if (DEBUG) {
+    Serial.print(row);
+    Serial.print(" ");
+    Serial.print(col);
+    Serial.print(" actualRow ");
+    Serial.print(actualRow);
+    Serial.print(" offset ");
+    Serial.print(offset);
+    Serial.print("\n");
+  }
+
+  if (reverse == 1) {
+    return offset + (rowLength - (col - col_offset)) + actualRow*LEDS_PER_STRIP;
+  } else {
+    return offset + (col - col_offset) + actualRow*LEDS_PER_STRIP;
+  }
+
+}
+
+
+void plasma() {
+  frameCount += (dialSpeed/18.0) + 1;
+  uint16_t t = fastCosineCalc((42 * frameCount)/100);  //time displacement - fiddle with these til it looks good...
+  uint16_t t2 = fastCosineCalc((25 * frameCount)/100);
+  uint16_t t3 = fastCosineCalc((38 * frameCount)/100);
+  uint16_t pixelIndex = 0;
+
+  uint8_t startRow = 0;
+  uint8_t endRow = 10;
+  if (masterTeensy) { startRow += 10; endRow += 9; }
+
+  for (uint8_t y = startRow; y < endRow; y++) {
+    pixelIndex = getPixelIndex(y, 0);
+    if (DEBUG) {
+      Serial.print("pixelIndex y x i ");
+      Serial.print(y);
+      Serial.print(" ");
+      Serial.print(0);
+      Serial.print(" ");
+      Serial.print(pixelIndex);
+      Serial.print("\n");
+    }
+    for (uint8_t x = 0; x < maxRowLength ; x++) {
+      pixelIndex = getPixelIndex(y, x);
+      if (pixelIndex < 0) continue;
+      //Calculate 3 seperate plasma waves, one for each color channel
+      uint8_t r = fastCosineCalc(((x << 3) + (t >> 1) + fastCosineCalc((t2 + (y << 3)))));
+      uint8_t g = fastCosineCalc(((y << 3) + t + fastCosineCalc(((t3 >> 2) + (x << 3)))));
+      uint8_t b = fastCosineCalc(((y << 3) + t2 + fastCosineCalc((t + x + (g >> 2)))));
+      //uncomment the following to enable gamma correction
+      r=pgm_read_byte_near(exp_gamma+r);
+      g=pgm_read_byte_near(exp_gamma+g);
+      b=pgm_read_byte_near(exp_gamma+b);
+      r *= max(0.05,(dialSpeed / 140.0));
+      g *= max(0.05,(dialSpeed / 140.0));
+      b *= max(0.05,(dialSpeed / 140.0));
+      leds.setPixel(pixelIndex, ((r << 16) | (g << 8) | b));
+      // pixelIndex += left2Right; optimisation!
+    }
+  }
+  digitalWrite(13, HIGH);
+  leds.show();  // not sure if this function is needed  to update each frame
+  digitalWrite(13, LOW);
+}
+
+
+
+void loop()
+{
+    if (displayState == SHOW_PLASMA) {
+      plasma();
+    } else {
+      delay(100);
+    }
+  // read the state of the switch into a local variable:
+  int reading = digitalRead(bigButtonAndControlPin);
+
+  if (masterTeensy) {
+    // check to see if you just pressed the button
+    // (i.e. the input went from LOW to HIGH),  and you've waited
+    // long enough since the last press to ignore any noise:
+
+    // If the switch changed, due to noise or pressing:
+    /*if (reading != lastBigButtonState) {
+      // reset the debouncing timer
+      lastDebounceTime = millis();
+    }
+    if (!reading) {
+      Serial.println("beep");
+    }*/
+
+    if (1) { //(millis() - lastDebounceTime) > debounceDelay) {
+      // whatever the reading is at, it's been there for longer
+      // than the debounce delay, so take it as the actual current state:
+
+      // if the button state has changed:
+      if (reading != bigButtonState) {
+        bigButtonState = reading;
+        // only toggle the LED if the new button state is HIGH
+        if (bigButtonState == LOW) {
+          if (DEBUG) Serial.println("Button pushed.");
+          if (displayState == INACTIVE) {
+            displayState = SHOW_PLASMA;
+            if (DEBUG) Serial.println("Write low!");
+            digitalWrite(masterPin, LOW);
+          } else {
+            clearPixels();
+            leds.show();
+            displayState = INACTIVE;
+            if (DEBUG) Serial.println("Write high!");
+            digitalWrite(masterPin, HIGH);
+          }
+        }
+      }
+    }
+
+    if (masterTeensy && (millis() - lastDialTime) > dialDelay) {
+      dialSpeed = readDial();
+      Serial.println(dialSpeed);
+      Serial1.write(255);
+      Serial1.write(255);
+      Serial1.write(255);
+      Serial1.write(255);
+      Serial1.write(255);
+      Serial1.write(255);
+      Serial1.write(255);
+      Serial1.write(255);
+      Serial1.write((uint8_t) dialSpeed);
+      unsigned long val = frameCount;
+      byte b[4];
+      b[3] = (byte )((val >> 24) & 0xff);
+      b[2] = (byte )((val >> 16) & 0xff);
+      b[1] = (byte )((val >> 8) & 0xff);
+      b[0] = (byte )(val & 0xff);
+
+      unsigned long val2;
+      memcpy(&val2, b, sizeof(unsigned long));
+      Serial.print("Sent frameCount == ");
+      Serial.println(val2);
+
+      for (int i=0; i<4; ++i) {
+        Serial1.write(b[i]);
+      }
+      lastDialTime = millis();
+    }
+  } else {
+    if (Serial1.available() >= 13) {
+      int data = Serial1.read();
+      int sync = 0;
+      while ((char)data == 255) {
+        sync++;
+        while (!Serial1.available() ) {};
+        data = Serial1.read();
+      }
+      if (sync >= 7) {
+        dialSpeed = data;
+        byte b[4];
+        int data_count = 0;
+        while (data_count < 4) {
+           if (Serial1.available()) {
+             data = Serial1.read();
+             b[data_count] = data;
+             data_count += 1;
+           }
+        }
+        unsigned long val;
+        memcpy(&val,b,sizeof(unsigned long));
+
+        if (DEBUG) {
+          Serial.print("Got dialspeed == ");
+          Serial.print(dialSpeed);
+          Serial.print(" frameCount == ");
+          Serial.print(val);
+          Serial.print(" drift=");
+          Serial.println(val - frameCount);
+          }
+        frameCount = val;
+      }
+    }
+    // Slave mode
+    if (bigButtonState != reading) {
+      bigButtonState = reading;
+      if (bigButtonState == LOW) {
+        if (DEBUG) Serial.println("Read low");
+        displayState = SHOW_PLASMA;
+
+      } else {
+        if (DEBUG) Serial.println("Read high");
+        clearPixels();
+        leds.show();
+        displayState = INACTIVE;
+
+      }
+    }
+  }
+
+  // save the reading.  Next time through the loop,
+  // it'll be the lastButtonState:
+  lastBigButtonState = reading;
+
+}
+
+inline uint8_t fastCosineCalc( uint16_t preWrapVal)
+{
+  uint8_t wrapVal = (preWrapVal % 255);
+  if (wrapVal<0) wrapVal=255+wrapVal;
+  return (pgm_read_byte_near(cos_wave+wrapVal));
+}


Fixed Test

Fixed Test

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/tylergrreid/Arduino_Flight_Computer.git/'


Created initial test arduino sketch

Created initial test arduino sketch

this sketch is supposed to imitate the 40 boards getting randomly wetter
and reporting the values back over serial.

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

--- Arduino/LEDWaterWallSketch/LEDWaterWallSketch.ino
+++ Arduino/LEDWaterWallSketch/LEDWaterWallSketch.ino
@@ -0,0 +1,122 @@
+/*
+ * LED Water Wall
+ *
+ * The arduino will be getting analog wetness values from
+ * each LED board then sending them as a byte array over
+ * USB serial to a laptop running the main interface
+ * program for music and other bonus output.
+ *
+ * https://256.makerslocal.org/wiki/LED_Water_Wall
+ */
+
+int AnalogPin1 = 0;
+int AnalogPin2 = 1;
+int AnalogPin3 = 2;
+int AnalogPin4 = 3;
+int AnalogPin5 = 4;
+int AnalogPin6 = 5;
+int PollingSeconds = 5; //num seconds to wait between checks
+int const TotalBoards = 40; //the total number of LED board modules
+int wetnessValues[TotalBoards]; //all the analog values from each board
+
+//setup all the pin modes for reading in the wetness from the
+//LED wall boards as well as getting the USB serial set up
+//to send byte arrays to a laptop running the main interface
+//program for music and other bonus output.
+void setup()
+{
+  Serial.begin(4800);
+  while (!Serial) {
+    ; // wait for serial port to connect. Needed for Leonardo only
+  }
+  for (int i = 0; i < TotalBoards; i++)
+  {
+    wetnessValues[i] = 0;
+  }
+  Serial.println("LEDWaterWall arduino serial online and ready.");
+}
+
+//gets each wetness value from the analog inputs and returns it
+// as an array of bytes.
+void getWetnessValues(int wetnessValues[])
+{
+  //loop through each board
+
+    //read analog in for that board
+    //analogRead();
+
+    //add that value as a byte to the return array
+
+  //end loop
+
+  //for now just return test values
+  incrementValues(wetnessValues);
+
+}
+
+//randomly increment random values in the given array
+//by a random amount and return the array.
+void incrementValues(int wetVals[])
+{
+  int index = 0;
+  int increment = 0;
+  int wetVal = 0;
+  while (index < TotalBoards)
+  {
+    //First pick the random index
+    index += random(5);
+
+    //then choose how much to increment by.
+    increment = random(500);
+
+    //get the value at that index (bounds check!)
+    if(index >= TotalBoards)
+    {
+      index = TotalBoards - 1;
+    }
+
+    wetVal = wetVals[index];
+
+    //first time through will be all zeros so set them to something
+    if (!wetVal)
+    {
+      wetVal = 0;
+    }
+
+    Serial.println("got index: " + index);
+    Serial.println("got increment: " + increment);
+    Serial.println("got wetVal: " + wetVal);
+
+    //check if that value would go over 1024 if incremented
+    wetVal += increment;
+    if (wetVal > 1024)
+    {
+      //if so then just set it to 1024
+      wetVal = 1024;
+    }
+
+    wetVals[index] = wetVal;
+
+    if(index == TotalBoards - 1)
+    {
+       index = TotalBoards;
+    }
+  }
+}
+
+void loop()
+{
+  //read the values from the wall
+  getWetnessValues(wetnessValues);
+
+  for(int i = 0; i<TotalBoards; i++)
+  {
+    //Serial.print(wetnessValues[i]);
+  }
+
+  Serial.println("");
+
+  delay(PollingSeconds * 1000); //wait a few seconds.
+}
+
+


New scissor lift control code which can accept negative number. And switch from absolute height to relative height(reference from the last command)

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

--- arduino/Scissor_Lift_Control_IR_0427.ino
+++ arduino/Scissor_Lift_Control_IR_0427.ino
@@ -0,0 +1,244 @@
+
+#include <ros.h>
+#include <std_msgs/String.h>
+#include <std_msgs/Int32.h>
+
+
+ros::NodeHandle  nh;
+std_msgs::String str_msg;
+//ros::Publisher chatter("chatter", &str_msg);
+
+int relay1 = 7;
+int relay2 = 5;
+int relay3 = 4;
+int relay4 = 3;
+
+const int ir_pin= A0;
+
+float ir_distance ;
+float ir_volt;
+
+#define arr_size 11
+
+int measured_vals[arr_size] = {0,0,0,0,0,0,0,0,0,0,0};
+int filter_result =0;
+
+
+unsigned long start, finished, elapsed, exe_period;
+unsigned long ini_pos, des_pos, tmp_pos;
+
+
+void get_height( const std_msgs::Int32& cmd_msg)
+{
+
+  des_pos = cmd_msg.data + ini_pos;
+  if(des_pos != ini_pos)
+
+  {
+    if(des_pos > ini_pos)
+    {
+      Serial.println("start up");
+      tmp_pos = get_IRdistance_filtered();
+
+      Serial.println(tmp_pos);
+      while(abs(des_pos-tmp_pos)>1 && des_pos >= tmp_pos)
+
+      {
+        digitalWrite(relay2, HIGH);
+
+        digitalWrite(relay3, HIGH);
+        digitalWrite(relay1, LOW);
+        digitalWrite(relay4, LOW);
+        //delay(1000);
+
+        tmp_pos = get_IRdistance_filtered();
+        Serial.println(tmp_pos);
+      }
+
+      Serial.println("finish up");
+    }
+    else
+    {
+        Serial.println("start down");
+        tmp_pos = get_IRdistance_filtered();
+        Serial.println(tmp_pos);
+
+        while(abs(des_pos-tmp_pos)>1 && tmp_pos >= des_pos)
+
+        {
+
+          digitalWrite(relay1, HIGH);
+          digitalWrite(relay4, HIGH);
+          digitalWrite(relay2, LOW);
+          digitalWrite(relay3, LOW);
+          //delay(1000);
+          tmp_pos = get_IRdistance_filtered();
+          Serial.println(tmp_pos);
+        }
+        Serial.println("finish down");
+     }
+     ini_pos = tmp_pos;
+     des_pos =0;
+     tmp_pos =0;
+     digitalWrite(relay1, HIGH);
+     digitalWrite(relay2, HIGH);
+     digitalWrite(relay3, HIGH);
+     digitalWrite(relay4, HIGH);
+  }
+}
+
+ros::Subscriber<std_msgs::Int32> sub("target_height", &get_height);
+
+
+
+void setup()
+{
+  nh.initNode();
+  nh.subscribe(sub);
+  //ini_pos =70 ;
+
+  Serial.begin(57600);
+  Serial.read();
+
+  pinMode(relay1, OUTPUT);
+  pinMode(relay2, OUTPUT);
+  pinMode(relay3, OUTPUT);
+  pinMode(relay4, OUTPUT);
+
+  // initialize output pins
+  digitalWrite(relay1, HIGH);
+  digitalWrite(relay2, HIGH);
+  digitalWrite(relay3, HIGH);
+  digitalWrite(relay4, HIGH);
+  initialize_pos();
+}
+
+void loop()
+{
+  nh.spinOnce();
+  delay(200);
+
+}
+
+void initialize_pos()
+{
+  des_pos = 40;
+  ini_pos = get_IRdistance_filtered();
+
+  if(des_pos != ini_pos)
+  {
+    if(des_pos > ini_pos)
+    {
+      Serial.println("start up");
+      tmp_pos = get_IRdistance_filtered();
+      while(abs(des_pos-tmp_pos)>1 && des_pos >= tmp_pos)
+      {
+
+        digitalWrite(relay2, HIGH);
+        digitalWrite(relay3, HIGH);
+        digitalWrite(relay1, LOW);
+        digitalWrite(relay4, LOW);
+        //delay(1000);
+        tmp_pos = get_IRdistance_filtered();
+      }
+      Serial.println("finish up");
+    }
+    else
+    {
+        Serial.println("start down");
+        tmp_pos = get_IRdistance_filtered();
+        while( abs(des_pos-tmp_pos)>1 && tmp_pos >= des_pos)
+        {
+          digitalWrite(relay1, HIGH);
+          digitalWrite(relay4, HIGH);
+          digitalWrite(relay2, LOW);
+          digitalWrite(relay3, LOW);
+          //delay(1000);
+          tmp_pos = get_IRdistance_filtered();
+        }
+        Serial.println("finish down");
+     }
+     ini_pos = tmp_pos;
+     des_pos =0;
+     tmp_pos =0;
+     digitalWrite(relay1, HIGH);
+     digitalWrite(relay2, HIGH);
+     digitalWrite(relay3, HIGH);
+     digitalWrite(relay4, HIGH);
+  }
+}
+
+
+int get_IRdistance_filtered() {
+  // Clear array
+  memset(measured_vals,0,sizeof(measured_vals));
+  for( int i = 0; i < arr_size; i++) {
+    // Pulse width representation.
+    // Scale factor of 147 uS per Inch
+    ir_volt = analogRead(ir_pin)*0.0048828;
+    ir_distance = 65 * pow(ir_volt, -1.10);
+    //Serial.println(ir_distance);
+    measured_vals[i] = ir_distance;
+    //sum= sum + measured_vals[i];
+    delay(40);
+  }
+
+  sort_array(arr_size, measured_vals);
+  filter_result = mode(arr_size, measured_vals);
+  filter_result = filter_result-6;
+  //Serial.println(filter_result);
+  //filter_result = sum / arr_size;
+  if(filter_result >150) filter_result =150;
+  else if(filter_result <20) filter_result =20;
+
+  Serial.println(filter_result);
+  return filter_result;
+}
+
+void sort_array(int array_size, int *val_array) {
+ for (int i = 1; i < array_size; i++) {
+   int j = val_array[i];
+   int k;
+   for (k = i - 1; (k >= 0) && (j < val_array[k]); k--) {
+     val_array[k+1] = val_array[k];
+   }
+   val_array[k+1] = j;
+ }
+}
+
+int mode(int array_size,int
+*val_array){
+ int i = 0;
+ int count = 0;
+ int maxCount = 0;
+ int mode = 0;
+ int bimodal;
+ int prevCount = 0;
+ while(i < (array_size-1)){
+   prevCount = count;
+   count = 0;
+   while(val_array[i] == val_array[i+1]){
+     count++;
+     i++;
+
+
+   }
+   if(count > prevCount && count > maxCount){
+     mode = val_array[i];
+     maxCount = count;
+     bimodal = 0;
+   }
+   if(count == 0){
+     i++;
+   }
+   if(count == maxCount){      //If the dataset has 2 or more modes.
+     bimodal = 1;
+   }
+   //Return the median if there is no mode.
+   if(mode == 0 || bimodal == 1){
+     mode = val_array[(array_size/2)];
+   }
+   return mode;
+ }
+}
+


Create tcp-server.ino

Create tcp-server.ino

error: pathspec 'spark-as-server/tcp-server.ino' did not match any file(s) known to git

--- spark-as-server/tcp-server.ino
+++ spark-as-server/tcp-server.ino
@@ -0,0 +1,33 @@
+
+
+TCPServer server = TCPServer(23);
+TCPClient client;
+
+void setup()
+{
+  // start listening for clients
+  server.begin();
+
+  // Make sure your Serial Terminal app is closed before powering your Core
+  Serial.begin(9600);
+  // Now open your Serial Terminal, and hit any key to continue!
+  while(!Serial.available()) SPARK_WLAN_Loop();
+
+  Serial.println(WiFi.localIP());
+  Serial.println(WiFi.subnetMask());
+  Serial.println(WiFi.gatewayIP());
+  Serial.println(WiFi.SSID());
+}
+
+void loop()
+{
+  if (client.connected()) {
+    // echo all available bytes back to the client
+    while (client.available()) {
+      server.write(client.read());
+    }
+  } else {
+    // if no client is yet connected, check for a new connection
+    client = server.available();
+  }
+}


introductory and response tune, upper limit

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/ocean-x/erikson-1.git/'


changed 'forward speed' to 'horizontal speed'


Add AirBoard BLE example

Add AirBoard BLE example

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

--- examples/Boards_Bluetooth/TheAirBoard_BLE_Link/TheAirBoard_BLE_Link.ino
+++ examples/Boards_Bluetooth/TheAirBoard_BLE_Link/TheAirBoard_BLE_Link.ino
@@ -0,0 +1,84 @@
+/**************************************************************
+ * Blynk is a platform with iOS and Android apps to control
+ * Arduino, Raspberry Pi and the likes over the Internet.
+ * You can easily build graphic interfaces for all your
+ * projects by simply dragging and dropping widgets.
+ *
+ *   Downloads, docs, tutorials: http://www.blynk.cc
+ *   Blynk community:            http://community.blynk.cc
+ *   Social networks:            http://www.fb.com/blynkapp
+ *                               http://twitter.com/blynk_app
+ *
+ * Blynk library is licensed under MIT license
+ * This example code is in public domain.
+ *
+ **************************************************************
+ *
+ * This example shows how to use AirBoard + BLE-Link
+ * to connect your project to Blynk.
+ *
+ * NOTE: BLE support is in beta!
+ *
+ **************************************************************
+ *            USB HOWTO: http://tiny.cc/BlynkUSB
+ **************************************************************/
+
+//#define BLYNK_USE_DIRECT_CONNECT
+
+#include <SoftwareSerial.h>
+SoftwareSerial DebugSerial(10, 11); // RX, TX
+
+#define BLYNK_PRINT DebugSerial
+
+#include <BlynkSimpleSerialBLE.h>
+
+// You should get Auth Token in the Blynk App.
+// Go to the Project Settings (nut icon).
+char auth[] = "YourAuthToken";
+
+#include <SimpleTimer.h>
+SimpleTimer timer;
+
+void setup()
+{
+  DebugSerial.begin(9600);
+
+  // Blynk works through Serial
+  // Do not read or write this serial manually in your sketch
+  Serial.begin(115200);
+  Blynk.begin(Serial, auth);
+
+  setLED(0x04, 0x16, 0x10);
+
+  timer.setInterval(1000L, []() {
+    Blynk.virtualWrite(V1, millis());
+  });
+}
+
+void loop()
+{
+  Blynk.run();
+  timer.run();
+}
+
+#define LED_RED   9
+#define LED_GREEN 5
+#define LED_BLUE  6
+
+void setLED(byte r, byte g, byte b) {
+  analogWrite(LED_RED,   r);
+  analogWrite(LED_GREEN, g);
+  analogWrite(LED_BLUE,  b);
+}
+
+BLYNK_CONNECTED() {
+  setLED(0x00, 0x00, 0x20);
+}
+
+BLYNK_WRITE(V0) {
+  int r = param[0].asInt();
+  int g = param[1].asInt();
+  int b = param[2].asInt();
+  setLED(r, g, b);
+}
+


split 1-wire bus, part 1

split 1-wire bus, part 1

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/wsnook/farm.git/'


Added popup example.

Added popup example.

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

--- examples/Popup_Example/Popup_Example.ino
+++ examples/Popup_Example/Popup_Example.ino
@@ -0,0 +1,45 @@
+#include <SPI.h>
+#include <Popup.h>
+
+Canvas canvas = Canvas();
+Popup popup = Popup();
+
+void setup() {
+  Serial.begin(9600);
+  canvas.init(TFT_LANDSCAPE);
+  pinMode(7,OUTPUT);
+  digitalWrite(7,HIGH);
+
+  popup.setSize(220,100);
+  popup.setColors(GRAY1,BLACK,WHITE);
+  popup.setText("Do you like it?","Yes","No");
+  popup.setEventHandler(&popupEventHandler);
+  popup.type = 1;
+  popup.init();
+  popup.visible = true;
+  //popup.setDebounce(100);
+
+  canvas.add(&popup,50,70);
+}
+
+void loop() {
+  canvas.scan();
+}
+
+void popupEventHandler(Popup* pup, unsigned char val){
+  Serial.print("Button ");Serial.print(val);
+  Serial.println(" pressed");
+  if(pup->type){
+    pup->type = 0;
+    if(val==1){
+      pup->setText("Nothing to do","Ok");
+    }else{
+      pup->setText("Should've said Yes","Ok");
+    }
+  }else{
+    pup->type = 1;
+    pup->setText("Do you like it?","Yes","No");
+  }
+  pup->visible = true;
+  canvas.redraw();
+}


add wave trigger config file

add wave trigger config file

error: pathspec 'coni/wave-trigger/wavtrigr.ino' did not match any file(s) known to git


encoder calc test

encoder calc test

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

--- testing/arduino/omniwheel4_Encoderb.ino
+++ testing/arduino/omniwheel4_Encoderb.ino
@@ -0,0 +1,174 @@
+#include "Arduino.h"
+
+int motorPin1_1 = 4;
+int motorPin1_2 = 5;
+int motorPin1_speed = 3;
+int motorPin1_A = A7;
+
+int motorPin2_1 = 7;
+int motorPin2_2 = 8;
+int motorPin2_speed = 6;
+int motorPin2_A = A6;
+
+int motorPin3_1 = 10;
+int motorPin3_2 = 11;
+int motorPin3_speed = 9;
+int motorPin3_A = A5;
+
+int globalSpeedInit = 255;
+int reducedSpeed = globalSpeedInit * 0.09;
+
+void setup()
+{
+    Serial.begin(9600);
+    while (!Serial)
+        ;
+    Serial.println("Init");
+
+    pinMode(motorPin1_1, OUTPUT);
+    pinMode(motorPin1_2, OUTPUT);
+    pinMode(motorPin1_speed, OUTPUT);
+    pinMode(motorPin1_A, INPUT);
+
+    pinMode(motorPin2_1, OUTPUT);
+    pinMode(motorPin2_2, OUTPUT);
+    pinMode(motorPin2_speed, OUTPUT);
+    pinMode(motorPin2_A, INPUT);
+
+    pinMode(motorPin3_1, OUTPUT);
+    pinMode(motorPin3_2, OUTPUT);
+    pinMode(motorPin3_speed, OUTPUT);
+    pinMode(motorPin3_A, INPUT);
+
+}
+
+
+void SetMotor(int pinSpeed, int pin1, int pin2, int speed)
+{
+    analogWrite(pinSpeed, abs(speed));
+    if (speed < 0)
+    {
+        analogWrite(pin1, 0);
+        analogWrite(pin2, 255);
+    }
+    else
+    {
+        analogWrite(pin1, 255);
+        analogWrite(pin2, 0);
+    }
+
+    if (speed == 0)
+    {
+        analogWrite(pin1, 0);
+        analogWrite(pin2, 0);
+    }
+}
+
+int motor1_RPMCount = 0;
+int motor1_State = 0;
+int motor1_Lookup[55];
+
+int motor2_RPMCount = 0;
+int motor2_State = 0;
+int motor2_Lookup[55];
+
+int motor3_RPMCount = 0;
+int motor3_State = 0;
+int motor3_Lookup[55];
+
+unsigned long time = 0;
+
+
+100%    320cps
+90%     310
+...
+50%     100
+...
+10      15
+5       0
+
+
+
+
+
+bool init = false;
+unsigned long initTimestamp = 0;
+int initSpeed = 255;
+
+
+// 1 Rotation == 80 Gearbox Ratio ==
+//      4 CPR (counts per revolution) * 80 == 320 Counts per Rotation
+int pulsesPerRotation = 320
+
+
+void loop()
+{
+    time = millis();
+
+    UpdateRPM();
+
+
+    if(!init)
+    {
+        motor1_RPMCount = 0;
+        motor2_RPMCount = 0;
+        motor3_RPMCount = 0;
+
+        SetWheelsTo(initSpeed);
+        initTimestamp = time;
+        init = true;
+        return;
+    }
+
+    if (initTimestamp + 100 <= time && initSpeed > 0)
+    {
+        //motor1_Lookup[motor1_RPMCount] = initSpeed;
+        //motor2_Lookup[motor2_RPMCount] = initSpeed;
+        //motor3_Lookup[motor3_RPMCount] = initSpeed;
+
+        initSpeed -= 5;
+
+        SetWheelsTo(initSpeed);
+        initTimestamp = time;
+
+        motor1_RPMCount = 0;
+        motor2_RPMCount = 0;
+        motor3_RPMCount = 0;
+        return;
+    }
+
+}
+
+void SetWheelsTo(int speed)
+{
+    SetMotor(motorPin1_speed, motorPin1_1, motorPin1_2, speed);
+    SetMotor(motorPin2_speed, motorPin2_1, motorPin2_2, speed);
+    SetMotor(motorPin3_speed, motorPin3_1, motorPin3_2, speed);
+}
+
+
+
+void UpdateRPM()
+{
+    int state = (analogRead(motorPin1_A) < 500) ? 0 : 1;
+    if(state != motor1_State)
+    {
+        motor1_RPMCount++;
+        motor1_State = state;
+    }
+
+    state = (analogRead(motorPin2_A) < 500) ? 0 : 1;
+    if(state != motor2_State)
+    {
+        motor2_RPMCount++;
+        motor2_State = state;
+    }
+
+    state = (analogRead(motorPin3_A) < 500) ? 0 : 1;
+    if(state != motor3_State)
+    {
+        motor3_RPMCount++;
+        motor3_State = state;
+    }
+}
+


Create heart_blood_pulsing.ino

Create heart_blood_pulsing.ino

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

--- heart_blood_pulsing.ino
+++ heart_blood_pulsing.ino
@@ -0,0 +1,75 @@
+//***************************************************************
+// Heart pulse, blood flowing example
+//
+// Marc Miller, Jan 2016
+//***************************************************************
+#include "FastLED.h"
+#define LED_TYPE LPD8806
+#define DATA_PIN 11
+#define CLOCK_PIN 13
+#define NUM_LEDS 32
+#define COLOR_ORDER GRB
+CRGB leds[NUM_LEDS];
+#define BRIGHTNESS  255
+
+
+uint8_t bloodHue = 96;  // Blood color [hue from 0-255]
+uint8_t bloodSat = 255;  // Blood staturation [0-255]
+int flowDirection = -1;   // Use either 1 or -1 to set flow direction
+uint16_t cycleLength = 1500;  // Lover values = continuous flow, higher values = distinct pulses.
+uint16_t pulseLength = 150;  // How long the pulse takes to fade out.  Higher value is longer.
+uint16_t pulseOffset = 200;  // Delay before second pulse.  Higher value is more delay.
+uint8_t baseBrightness = 10;  // Brightness of LEDs when not pulsing. Set to 0 for off.
+
+
+//---------------------------------------------------------------
+void setup() {
+  Serial.begin(115200);
+  delay(3000);  // 3 second delay
+  //FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
+  FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
+  FastLED.setBrightness(BRIGHTNESS);
+}
+
+//---------------------------------------------------------------
+void loop() {
+  heartBeat();  // Heart beat function
+  FastLED.show();
+}
+
+
+//===============================================================
+// Heart Beat Functions
+//   The base for all this goodness came from Mark Kriegsman and
+//   was initially coded up by Chris Thodey.  I updated it to use
+//   HSV and provided all the variables to play with up above.
+//   -Marc
+
+void heartBeat(){
+  for (int i = 0; i < NUM_LEDS ; i++) {
+    uint8_t bloodVal = sumPulse( (5/NUM_LEDS/2) + (NUM_LEDS/2) * i * flowDirection );
+    leds[i] = CHSV( bloodHue, bloodSat, bloodVal );
+  }
+}
+
+int sumPulse(int time_shift) {
+  //time_shift = 0;  //Uncomment to heart beat/pulse all LEDs together
+  int pulse1 = pulseWave8( millis() + time_shift, cycleLength, pulseLength );
+  int pulse2 = pulseWave8( millis() + time_shift + pulseOffset, cycleLength, pulseLength );
+  return qadd8( pulse1, pulse2 );  // Add pulses together without overflow
+}
+
+uint8_t pulseWave8(uint32_t ms, uint16_t cycleLength, uint16_t pulseLength) {
+  uint16_t T = ms % cycleLength;
+  if ( T > pulseLength) return baseBrightness;
+  uint16_t halfPulse = pulseLength / 2;
+  if (T <= halfPulse ) {
+    return (T * 255) / halfPulse;  //first half = going up
+  } else {
+    return((pulseLength - T) * 255) / halfPulse;  //second half = going down
+  }
+}
+//End_heart_beat_functions
+//---------------------------------------------------------------
+
+


Added cooldown reset when '0' is pressed and the strip is off.

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/VaSe7u/Music_LED_strip.git/'


Reset counter even when there's nothing to send

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/mvines/futboard.git/'