Initial commit

Initial commit

Starting Pulse Sensor Merge

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

--- examples/BoardWithPulseSensor/BoardWithPulseSensor/BoardWithPulseSensor.ino
+++ examples/BoardWithPulseSensor/BoardWithPulseSensor/BoardWithPulseSensor.ino
@@ -0,0 +1,38 @@
+#include <DSPI.h>
+#include <OpenBCI_32bit_Library.h>
+#include <OpenBCI_32Bit_Library_Definitions.h>
+
+void setup() {
+  // Bring up the OpenBCI Board
+  board.begin();
+
+  // Notify the board we want to use aux data, this effects `::sendChannelData()`
+  board.useAux = true;
+}
+
+void loop() {
+
+  // The main dependency of this single threaded microcontroller is to
+  //  stream data from the ADS.
+  if (board.streaming) {
+    // Wait for the ADS to signal it's ready with new data
+    while (board.waitForNewChannelData()) {}
+
+    // Read from the ADS(s) and store data into
+    board.updateChannelData();
+
+    // Read from the analog sensor and store auxilary position 0
+    // take a reading from the ADC. Result range from 0 to 1023
+    board.auxData[0] = analogRead(A7);
+
+    // Send standard packet with channel data and accel data
+    //  includes aux data because we set told the board to add it
+    board.sendChannelData();
+  }
+
+  // Check the serial port for new data
+  if (board.isSerialAvailableForRead()) {
+    // Read one char and process it
+    board.processChar(board.readOneSerialChar());
+  }
+}


Created shell, added function to get button presses.

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

--- simon_says/simon_says.ino
+++ simon_says/simon_says.ino
@@ -0,0 +1,67 @@
+/**
+ * An Arduino circuit design and program that simulates the game "Simon Says".
+ *
+ * Author: David Timmons ( http://david.timmons.io )
+ * License: MIT
+ */
+
+// Turn debug mode on or off.
+const boolean DEBUG = true;
+
+// Define LED pin positions.
+const int RED_1 = 13;
+const int RED_2 = 12;
+const int RED_3 = 11;
+const int SIMON_1 = 5;
+const int SIMON_2 = 4;
+const int SIMON_3 = 3;
+const int SIMON_4 = 2;
+
+// Define switch pin positions.
+const int TILT = 10;
+const int BUTTONS = A1;
+
+
+/**
+ * Initialize the Arduino.
+ */
+void setup() {
+    // Print debug results to the serial monitor.
+    if (DEBUG) Serial.begin(9600);
+}
+
+
+/**
+ * Control the Arduino.
+ */
+void loop() {
+    // Check if a button switch was pressed.
+    int simonLed = getSimonLed(analogRead(BUTTONS));
+    if (DEBUG) {
+        Serial.print("Button <Analog, Result>: ");
+        Serial.print(analogRead(BUTTONS));
+        Serial.print(", ");
+        Serial.println(simonLed);
+    }
+}
+
+
+/**
+ * Return the LED associated with the active button switch.
+ */
+int getSimonLed(int keyVal) {
+
+    // Get the LED.
+    if (3 <= keyVal && keyVal <= 50) {
+      return SIMON_4;
+    } else if (500 <= keyVal && keyVal <= 550) {
+      return SIMON_3;
+    } else if (1000 <= keyVal && keyVal <= 1010) {
+      return SIMON_2;
+    } else if (keyVal >= 1020) {
+      return SIMON_1;
+    }
+
+    // The switch is not active.
+    return -1;
+}


eeprom_clear example: Set pinMode of LED pin

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/'


Added digitalWriteFast example.(#90)

Added digitalWriteFast example.(#90)

error: pathspec 'arduino/opencr_arduino/opencr/libraries/OpenCR/examples/01.' did not match any file(s) known to git
error: pathspec 'Basics/f_Gpio_Write_Speed_Test/f_Gpio_Write_Speed_Test.ino' did not match any file(s) known to git


adding QRS

adding QRS

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/willtmwu/cExamples.git/'


Create ssd1306_128x64_i2c.ino

Create ssd1306_128x64_i2c.ino

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

--- ssd1306_128x64_i2c.ino
+++ ssd1306_128x64_i2c.ino
@@ -0,0 +1,346 @@
+/*********************************************************************
+This is an example for our Monochrome OLEDs based on SSD1306 drivers
+
+  Pick one up today in the adafruit shop!
+  ------> http://www.adafruit.com/category/63_98
+
+This example is for a 128x64 size display using I2C to communicate
+3 pins are required to interface (2 I2C and one reset)
+
+Adafruit invests time and resources providing this open source code,
+please support Adafruit and open-source hardware by purchasing
+products from Adafruit!
+
+Written by Limor Fried/Ladyada  for Adafruit Industries.
+BSD license, check license.txt for more information
+All text above, and the splash screen must be included in any redistribution
+*********************************************************************/
+
+#include "Adafruit_GFX.h"
+#include "Adafruit_SSD1306.h"
+
+#define OLED_RESET D4
+Adafruit_SSD1306 display(OLED_RESET);
+
+#define NUMFLAKES 10
+#define XPOS 0
+#define YPOS 1
+#define DELTAY 2
+
+
+#define LOGO16_GLCD_HEIGHT 16
+#define LOGO16_GLCD_WIDTH  16
+static const unsigned char logo16_glcd_bmp[] =
+{ B00000000, B11000000,
+  B00000001, B11000000,
+  B00000001, B11000000,
+  B00000011, B11100000,
+  B11110011, B11100000,
+  B11111110, B11111000,
+  B01111110, B11111111,
+  B00110011, B10011111,
+  B00011111, B11111100,
+  B00001101, B01110000,
+  B00011011, B10100000,
+  B00111111, B11100000,
+  B00111111, B11110000,
+  B01111100, B11110000,
+  B01110000, B01110000,
+  B00000000, B00110000 };
+
+#if (SSD1306_LCDHEIGHT != 64)
+#error("Height incorrect, please fix Adafruit_SSD1306.h!");
+#endif
+
+void setup()   {
+  Serial.begin(9600);
+
+  // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
+  display.begin(SSD1306_SWITCHCAPVCC, 0x3D);  // initialize with the I2C addr 0x3D (for the 128x64)
+  // init done
+
+  display.display(); // show splashscreen
+  delay(2000);
+  display.clearDisplay();   // clears the screen and buffer
+
+  // draw a single pixel
+  display.drawPixel(10, 10, WHITE);
+  display.display();
+  delay(2000);
+  display.clearDisplay();
+
+  // draw many lines
+  testdrawline();
+  display.display();
+  delay(2000);
+  display.clearDisplay();
+
+  // draw rectangles
+  testdrawrect();
+  display.display();
+  delay(2000);
+  display.clearDisplay();
+
+  // draw multiple rectangles
+  testfillrect();
+  display.display();
+  delay(2000);
+  display.clearDisplay();
+
+  // draw mulitple circles
+  testdrawcircle();
+  display.display();
+  delay(2000);
+  display.clearDisplay();
+
+  // draw a white circle, 10 pixel radius
+  display.fillCircle(display.width()/2, display.height()/2, 10, WHITE);
+  display.display();
+  delay(2000);
+  display.clearDisplay();
+
+  testdrawroundrect();
+  delay(2000);
+  display.clearDisplay();
+
+  testfillroundrect();
+  delay(2000);
+  display.clearDisplay();
+
+  testdrawtriangle();
+  delay(2000);
+  display.clearDisplay();
+
+  testfilltriangle();
+  delay(2000);
+  display.clearDisplay();
+
+  // draw the first ~12 characters in the font
+  testdrawchar();
+  display.display();
+  delay(2000);
+  display.clearDisplay();
+
+  // draw scrolling text
+  testscrolltext();
+  delay(2000);
+  display.clearDisplay();
+
+  // text display tests
+  display.setTextSize(1);
+  display.setTextColor(WHITE);
+  display.setCursor(0,0);
+  display.println("Hello, world!");
+  display.setTextColor(BLACK, WHITE); // 'inverted' text
+  display.println(3.141592);
+  display.setTextSize(2);
+  display.setTextColor(WHITE);
+  display.print("0x"); display.println(0xDEADBEEF, HEX);
+  display.display();
+  delay(2000);
+
+  // miniature bitmap display
+  display.clearDisplay();
+  display.drawBitmap(30, 16,  logo16_glcd_bmp, 16, 16, 1);
+  display.display();
+
+  // invert the display
+  display.invertDisplay(true);
+  delay(1000);
+  display.invertDisplay(false);
+  delay(1000);
+
+  // draw a bitmap icon and 'animate' movement
+  testdrawbitmap(logo16_glcd_bmp, LOGO16_GLCD_HEIGHT, LOGO16_GLCD_WIDTH);
+}
+
+
+void loop() {
+
+}
+
+
+void testdrawbitmap(const uint8_t *bitmap, uint8_t w, uint8_t h) {
+  uint8_t icons[NUMFLAKES][3];
+
+  // initialize
+  for (uint8_t f=0; f< NUMFLAKES; f++) {
+    icons[f][XPOS] = random(display.width());
+    icons[f][YPOS] = 0;
+    icons[f][DELTAY] = random(5) + 1;
+
+    Serial.print("x: ");
+    Serial.print(icons[f][XPOS], DEC);
+    Serial.print(" y: ");
+    Serial.print(icons[f][YPOS], DEC);
+    Serial.print(" dy: ");
+    Serial.println(icons[f][DELTAY], DEC);
+  }
+
+  while (1) {
+    // draw each icon
+    for (uint8_t f=0; f< NUMFLAKES; f++) {
+      display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, WHITE);
+    }
+    display.display();
+    delay(200);
+
+    // then erase it + move it
+    for (uint8_t f=0; f< NUMFLAKES; f++) {
+      display.drawBitmap(icons[f][XPOS], icons[f][YPOS],  logo16_glcd_bmp, w, h, BLACK);
+      // move it
+      icons[f][YPOS] += icons[f][DELTAY];
+      // if its gone, reinit
+      if (icons[f][YPOS] > display.height()) {
+	icons[f][XPOS] = random(display.width());
+	icons[f][YPOS] = 0;
+	icons[f][DELTAY] = random(5) + 1;
+      }
+    }
+   }
+}
+
+
+void testdrawchar(void) {
+  display.setTextSize(1);
+  display.setTextColor(WHITE);
+  display.setCursor(0,0);
+
+  for (uint8_t i=0; i < 168; i++) {
+    if (i == '\n') continue;
+    display.write(i);
+    if ((i > 0) && (i % 21 == 0))
+      display.println();
+  }
+  display.display();
+}
+
+void testdrawcircle(void) {
+  for (int16_t i=0; i<display.height(); i+=2) {
+    display.drawCircle(display.width()/2, display.height()/2, i, WHITE);
+    display.display();
+  }
+}
+
+void testfillrect(void) {
+  uint8_t color = 1;
+  for (int16_t i=0; i<display.height()/2; i+=3) {
+    // alternate colors
+    display.fillRect(i, i, display.width()-i*2, display.height()-i*2, color%2);
+    display.display();
+    color++;
+  }
+}
+
+void testdrawtriangle(void) {
+  for (int16_t i=0; i<min(display.width(),display.height())/2; i+=5) {
+    display.drawTriangle(display.width()/2, display.height()/2-i,
+                     display.width()/2-i, display.height()/2+i,
+                     display.width()/2+i, display.height()/2+i, WHITE);
+    display.display();
+  }
+}
+
+void testfilltriangle(void) {
+  uint8_t color = WHITE;
+  for (int16_t i=min(display.width(),display.height())/2; i>0; i-=5) {
+    display.fillTriangle(display.width()/2, display.height()/2-i,
+                     display.width()/2-i, display.height()/2+i,
+                     display.width()/2+i, display.height()/2+i, WHITE);
+    if (color == WHITE) color = BLACK;
+    else color = WHITE;
+    display.display();
+  }
+}
+
+void testdrawroundrect(void) {
+  for (int16_t i=0; i<display.height()/2-2; i+=2) {
+    display.drawRoundRect(i, i, display.width()-2*i, display.height()-2*i, display.height()/4, WHITE);
+    display.display();
+  }
+}
+
+void testfillroundrect(void) {
+  uint8_t color = WHITE;
+  for (int16_t i=0; i<display.height()/2-2; i+=2) {
+    display.fillRoundRect(i, i, display.width()-2*i, display.height()-2*i, display.height()/4, color);
+    if (color == WHITE) color = BLACK;
+    else color = WHITE;
+    display.display();
+  }
+}
+
+void testdrawrect(void) {
+  for (int16_t i=0; i<display.height()/2; i+=2) {
+    display.drawRect(i, i, display.width()-2*i, display.height()-2*i, WHITE);
+    display.display();
+  }
+}
+
+void testdrawline() {
+  for (int16_t i=0; i<display.width(); i+=4) {
+    display.drawLine(0, 0, i, display.height()-1, WHITE);
+    display.display();
+  }
+  for (int16_t i=0; i<display.height(); i+=4) {
+    display.drawLine(0, 0, display.width()-1, i, WHITE);
+    display.display();
+  }
+  delay(250);
+
+  display.clearDisplay();
+  for (int16_t i=0; i<display.width(); i+=4) {
+    display.drawLine(0, display.height()-1, i, 0, WHITE);
+    display.display();
+  }
+  for (int16_t i=display.height()-1; i>=0; i-=4) {
+    display.drawLine(0, display.height()-1, display.width()-1, i, WHITE);
+    display.display();
+  }
+  delay(250);
+
+  display.clearDisplay();
+  for (int16_t i=display.width()-1; i>=0; i-=4) {
+    display.drawLine(display.width()-1, display.height()-1, i, 0, WHITE);
+    display.display();
+  }
+  for (int16_t i=display.height()-1; i>=0; i-=4) {
+    display.drawLine(display.width()-1, display.height()-1, 0, i, WHITE);
+    display.display();
+  }
+  delay(250);
+
+  display.clearDisplay();
+  for (int16_t i=0; i<display.height(); i+=4) {
+    display.drawLine(display.width()-1, 0, 0, i, WHITE);
+    display.display();
+  }
+  for (int16_t i=0; i<display.width(); i+=4) {
+    display.drawLine(display.width()-1, 0, i, display.height()-1, WHITE);
+    display.display();
+  }
+  delay(250);
+}
+
+void testscrolltext(void) {
+  display.setTextSize(2);
+  display.setTextColor(WHITE);
+  display.setCursor(10,0);
+  display.clearDisplay();
+  display.println("scroll");
+  display.display();
+
+  display.startscrollright(0x00, 0x0F);
+  delay(2000);
+  display.stopscroll();
+  delay(1000);
+  display.startscrollleft(0x00, 0x0F);
+  delay(2000);
+  display.stopscroll();
+  delay(1000);
+  display.startscrolldiagright(0x00, 0x07);
+  delay(2000);
+  display.startscrolldiagleft(0x00, 0x07);
+  delay(2000);
+  display.stopscroll();
+}


added alarm enable&disable command

added alarm enable&disable command

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/jeremywrnr/wampum.git/'


Added I2C board for 2-wire display control

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

--- mwsLCDI2C/mwsLCDI2C.ino
+++ mwsLCDI2C/mwsLCDI2C.ino
@@ -0,0 +1,569 @@
+/*
+ Weather Shield Example
+ By: Nathan Seidle
+ SparkFun Electronics
+ Date: November 16th, 2013
+ License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
+
+ Much of this is based on Mike Grusin's USB Weather Board code: https://www.sparkfun.com/products/10586
+
+ This code reads all the various sensors (wind speed, direction, rain gauge, humidty, pressure, light, batt_lvl)
+ and reports it over the serial comm port. This can be easily routed to an datalogger (such as OpenLog) or
+ a wireless transmitter (such as Electric Imp).
+
+ Measurements are reported once a second but windspeed and rain gauge are tied to interrupts that are
+ calculated at each report.
+
+ This example code assumes the GP-635T GPS module is attached.
+
+ */
+
+#include <Wire.h> //I2C needed for sensors
+#include "MPL3115A2.h" //Pressure sensor
+#include "HTU21D.h" //Humidity sensor
+#include <SoftwareSerial.h> //Needed for GPS
+#include <TinyGPS++.h> //GPS parsing
+#include <LiquidCrystal_I2C.h>//16x2 LCD library
+//It requires using fm's LiquidCrystal library replacement:
+//https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home
+
+//This is for the 16x2 LCD
+LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
+
+//GPS
+TinyGPSPlus gps;
+static const int RXPin = 5, TXPin = 4; //GPS is attached to pin 4(TX from GPS) and pin 5(RX into GPS)
+SoftwareSerial ss(RXPin, TXPin);
+
+//Pressure & Humidity sensors on the weather shield
+MPL3115A2 myPressure; //Create an instance of the pressure sensor
+HTU21D myHumidity; //Create an instance of the humidity sensor
+
+// Change the rain bucket size with design
+const float RAINBUCKET = 0.011*25.4;// This is WS2080 in mm
+//const float RAINBUCKET = 0.01*25.4;// This is Davisnet Rain collector 2 in mm (to confirm)
+
+//Hardware pin definitions
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+// digital I/O pins
+const byte WSPEED = 3;//WIND SPEED is DIGITAL pin 3
+const byte RAIN = 2;// RAIN is DIGITAL pin 2
+const byte STAT1 = 7;//Status LED Blue
+const byte STAT2 = 8;//Status LED Green
+const byte GPS_PWRCTL = 6; //Pulling this pin low puts GPS to sleep but maintains RTC and RAM
+
+// analog I/O pins
+const byte REFERENCE_3V3 = A3;
+const byte LIGHT = A1;
+const byte BATT = A2;
+const byte WDIR = A0;//WIND DIRECTION is ANALOG pin 0
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+//Global Variables
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+long lastSecond; //The millis counter to see when a second rolls by
+byte seconds; //When it hits 60, increase the current minute
+byte seconds_2m; //Keeps track of the "wind speed/dir avg" over last 2 minutes array of data
+byte minutes; //Keeps track of where we are in various arrays of data
+byte minutes_10m; //Keeps track of where we are in wind gust/dir over last 10 minutes array of data
+byte minutes_5m; // Niroshan this is for 5 mnts rain
+
+//volatiles are subject to modification by IRQs
+long lastWindCheck = 0;
+volatile long lastWindIRQ = 0;
+volatile byte windClicks = 0;
+
+long lastRainCheck = 0;
+volatile long lastRainIRQ = 0;
+volatile byte rainClicks = 0;
+
+//We need to keep track of the following variables:
+//Wind speed/dir each update (no storage)
+//Wind gust/dir over the day (no storage)
+//Wind speed/dir, avg over 2 minutes (store 1 per second)
+//Wind gust/dir over last 10 minutes (store 1 per minute)
+//Rain over the past hour (store 1 per minute)
+//Total rain over date (store one per day)
+
+byte windspdavg[120]; //120 bytes to keep track of 2 minute average
+int winddiravg[120]; //120 ints to keep track of 2 minute average
+//float windgust_10m[10]; //10 floats to keep track of 10 minute max //Yann: to check if OK
+//int windgustdirection_10m[10]; //10 ints to keep track of 10 minute max
+
+//These are all the weather values that wunderground expects:
+//int winddir = 0; // [0-360 instantaneous wind direction]
+//float windspeedms = 0; // [mph instantaneous wind speed]
+//float windgustms = 0; // [mph current wind gust, using software specific time period]
+//int windgustdir = 0; // [0-360 using software specific time period]
+//float windspdms_avg2m = 0; // [mph 2 minute average wind speed mph]
+//int winddir_avg2m = 0; // [0-360 2 minute average wind direction]
+//float windgustms_10m = 0; // [mph past 10 minutes wind gust mph ]
+//int windgustdir_10m = 0; // [0-360 past 10 minutes wind gust direction]
+//float humidity = 0; // [%]
+//float tempc = 0; // [temperature C]
+float dailyrainin = 0; // [rain inches so far today in local time]
+float rainin = 0; // [rain inches over the past hour)] -- the accumulated rainfall in the past 60 min
+float rainin_5m = 0; // [rain inches over the past hour)] -- the accumulated rainfall in the past 60 min
+byte Rainindi = 0; // 5 minutes rain Flag
+//float baromin = 30.03;// [barom in] - It's hard to calculate baromin locally, do this in the agent
+//float pressure;
+//float dewptf; // [dewpoint F] - It's hard to calculate dewpoint locally, do this in the agent
+
+//float batt_lvl = 11.8; //[analog value from 0 to 1023]
+//float light_lvl = 455; //[analog value from 0 to 1023]
+
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+//Interrupt routines (these are called by the hardware interrupts, not by the main code)
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+//void rainIRQ()
+// Count rain gauge bucket tips as they occur
+// Activated by the magnet and reed switch in the rain gauge, attached to input D2
+//{
+//  if (millis() - rainlast > 10) // ignore switch-bounce glitches less than 10mS after initial edge
+//  {
+//    rainlast = millis(); // set up for next event
+//    dailyrainin += RAINBUCKET; //Each dump is RAINBUCKET of water
+//    rainHour[minutes] += RAINBUCKET; //Add this minute's amount of rain
+    //rain5m[minutes_5m] += RAINBUCKET; // Add this minute's amout of rain
+//  }
+  //Removed for dynamic memory reduction
+  //Nirosha
+  //Rain flag (1)
+  //if(rain5m[minutes_5m] > 0)
+  //{
+  //  Rainindi=1;
+  //}
+  //Niroshan
+//}
+
+void rainIRQ()
+// Count rain gauge bucket tips as they occur
+// Activated by the magnet and reed switch in the rain gauge, attached to input D2
+{
+  if (millis() - lastRainIRQ > 20) // Ignore switch-bounce glitches less than 20ms after the reed switch closes
+  {
+    lastRainIRQ = millis(); //Grab the current time
+    rainClicks++; //There is RAINBUCKET for each click per second.
+  }
+}
+
+void wspeedIRQ()
+// Activated by the magnet in the anemometer (2 ticks per rotation), attached to input D3
+{
+  if (millis() - lastWindIRQ > 20) // Ignore switch-bounce glitches less than 2x10ms (142MPH/2 max reading) after the reed switch closes
+  {
+    lastWindIRQ = millis(); //Grab the current time
+    windClicks++; //There is 1.492MPH for each click per second.
+  }
+}
+
+
+void setup()
+{
+  Serial.begin(9600);
+
+  // set up the LCD's number of columns and rows:
+  lcd.begin(16, 2);
+  lcd.backlight();
+  lcd.clear();
+  lcd.print(F("Display ON"));
+
+  ss.begin(9600); //Begin listening to GPS over software serial at 9600. This should be the default baud of the module.
+  Serial.print(F("lon,lat,altitude,sats,date,GMTtime,winddir"));
+  Serial.print(F(",windspeedms,windgustms,windspdms_avg2m,winddir_avg2m,windgustms_10m,windgustdir_10m"));
+  Serial.print(F(",humidity,tempc,raindailymm,rainhourmm,rain5mmm,rainindicate,pressure,batt_lvl,light_lvl"));
+
+  pinMode(STAT1, OUTPUT); //Status LED Blue
+  pinMode(STAT2, OUTPUT); //Status LED Green
+
+  pinMode(GPS_PWRCTL, OUTPUT);
+  digitalWrite(GPS_PWRCTL, HIGH); //Pulling this pin low puts GPS to sleep but maintains RTC and RAM
+
+  pinMode(WSPEED, INPUT_PULLUP); // input from wind meters windspeed sensor
+  pinMode(RAIN, INPUT_PULLUP); // input from wind meters rain gauge sensor
+
+  pinMode(REFERENCE_3V3, INPUT);
+  pinMode(LIGHT, INPUT);
+
+  //Configure the pressure sensor
+  myPressure.begin(); // Get sensor online
+  myPressure.setModeBarometer(); // Measure pressure in Pascals from 20 to 110 kPa
+  myPressure.setOversampleRate(7); // Set Oversample to the recommended 128
+  myPressure.enableEventFlags(); // Enable all three pressure and temp event flags
+
+  //Configure the humidity sensor
+  myHumidity.begin();
+
+  // attach external interrupt pins to IRQ functions
+  attachInterrupt(0, rainIRQ, FALLING);
+  attachInterrupt(1, wspeedIRQ, FALLING);
+
+  // turn on interrupts
+  interrupts();
+  digitalWrite(STAT1, HIGH); //Blink stat LED 1 second
+  delay(1000);
+  digitalWrite(STAT1, LOW); //Blink stat LED
+  delay(1000);
+  smartdelay(60000); //Wait 60 seconds, and gather GPS data
+  minutes = gps.time.minute();
+  //minutes_5m = gps.time.minute();
+  minutes_10m = gps.time.minute();
+  seconds = gps.time.second();
+  lastSecond = millis();
+}
+
+void loop()
+{
+  //Keep track of which minute it is
+  if(millis() - lastSecond >= 1000)
+  {
+    digitalWrite(STAT1, HIGH); //Blink stat LED
+    //Take a speed and direction reading every second for 2 minute average
+    seconds_2m += millis() - lastSecond;
+    if(seconds_2m > 119) seconds_2m = 0;
+
+    //Calc the wind speed and direction every second for 120 second to get 2 minute average
+    windspdavg[seconds_2m] = (int)get_wind_speed();
+    winddiravg[seconds_2m] = get_wind_direction();
+
+    seconds += millis() - lastSecond;
+    lastSecond = millis();
+    //Minutes loop
+    if(seconds > 59)
+    {
+      seconds = 0;
+
+      if(++minutes % 60 == 0) minutes = 0;
+      if(++minutes_10m % 10 == 0) minutes_10m = 0;
+      if(++minutes_5m % 5 == 0) Rainindi = 0;
+      if(++minutes_5m % 5 == 0) rainin_5m = 0;
+      if(minutes_5m % 5 == 0) minutes_5m = 0;
+
+      rainin = 0; //Zero out this minute's rainfall amount
+
+      //Report all readings every minute
+      printWeather();
+    }
+    digitalWrite(STAT1, LOW); //Turn off stat LED
+  }
+
+  smartdelay(800); //Wait 1 second, and gather GPS data
+}
+
+//While we delay for a given amount of time, gather GPS data
+static void smartdelay(unsigned long ms)
+{
+  unsigned long start = millis();
+  do
+  {
+      digitalWrite(STAT1, HIGH); //Blink stat LED
+      delay(500);
+      while (ss.available()) gps.encode(ss.read());
+      digitalWrite(STAT1, LOW); //Blink stat LED
+      delay(500);
+  }
+  while (millis() - start < ms);
+}
+
+//Returns the voltage of the light sensor based on the 3.3V rail
+//This allows us to ignore what VCC might be (an Arduino plugged into USB has VCC of 4.5 to 5.2V)
+float get_light_level()
+{
+  float operatingVoltage = analogRead(REFERENCE_3V3);
+  float lightSensor = analogRead(LIGHT);
+  operatingVoltage = 3.3 / operatingVoltage; //The reference voltage is 3.3V
+  lightSensor = operatingVoltage * lightSensor;
+  return(lightSensor);
+}
+
+//Returns the voltage of the raw pin based on the 3.3V rail
+//This allows us to ignore what VCC might be (an Arduino plugged into USB has VCC of 4.5 to 5.2V)
+//Battery level is connected to the RAW pin on Arduino and is fed through two 5% resistors:
+//3.9K on the high side (R1), and 1K on the low side (R2)
+float get_battery_level()
+{
+  float operatingVoltage = analogRead(REFERENCE_3V3);
+  float rawVoltage = analogRead(BATT);
+  operatingVoltage = 3.30 / operatingVoltage; //The reference voltage is 3.3V
+  rawVoltage = operatingVoltage * rawVoltage; //Convert the 0 to 1023 int to actual voltage on BATT pin
+  rawVoltage *= 4.90; //(3.9k+1k)/1k - multiple BATT voltage by the voltage divider to get actual system voltage
+  return(rawVoltage);
+}
+
+//Returns the instataneous wind speed
+float get_wind_speed()
+{
+  float deltaTime = millis() - lastWindCheck; //750ms
+  deltaTime /= 1000.0; //Convert to seconds
+  float windSpeed = (float)windClicks / deltaTime; //3 / 0.750s = 4
+  windClicks = 0; //Reset and start watching for new wind
+  lastWindCheck = millis();
+  windSpeed *= 1.492; //4 * 1.492 = 5.968MPH
+  windSpeed *= 0.44704; //5.968MPH * 0.44704 = 2.6679 m/s
+  if(windSpeed > 0.2) windSpeed -= 0.2;
+  return(windSpeed);
+}
+
+//Rain stats
+float get_rain()
+{
+  float rain = (float)rainClicks * RAINBUCKET; //3 * 0.011" = 0.033"
+  rainClicks = 0; //Reset and start watching for new wind
+  if(rain > 0.2) rain -= 0.2;//There is a persisting glitch in the IRQ
+  return(rain);
+}
+
+//Read the wind direction sensor, return heading in degrees
+int get_wind_direction()
+{
+  unsigned int adc = analogRead(WDIR); // get the current reading from the sensor
+
+  // The following table is ADC readings for the wind direction sensor output, sorted from low to high.
+  // Each threshold is the midpoint between adjacent headings. The output is degrees for that ADC reading.
+  // Note that these are not in compass degree order! See Weather Meters datasheet for more information.
+
+  if (adc < 380) return (113);//NOT WORKING
+  else if (adc < 393) return (68);//NOT WORKING
+  else if (adc < 414) return (90);//NOT WORKING
+  else if (adc < 456) return (90);//(158);//E is 90 degrees CW from North = 0
+  else if (adc < 508) return (135);//SE is 135 degrees CW from North = 0
+  else if (adc < 551) return (180);//(203);//S is 180 degrees CW from North = 0
+  else if (adc < 615) return (45);//(180);//NE is 45 degrees CW from North = 0
+  else if (adc < 680) return (23);//NOT WORKING
+  else if (adc < 746) return (225);//(45);//SW is 225 degrees CW from North = 0
+  else if (adc < 801) return (248);//NOT WORKING
+  else if (adc < 833) return (0);//(225);//N is 0 degrees CW from North = 0
+  else if (adc < 878) return (338);//NOT WORKING
+  else if (adc < 913) return (325);//(0);//NW is 325 degrees CW from North = 0
+  else if (adc < 940) return (293);//NOT WORKING
+  else if (adc < 967) return (270);//(315);//W is 270 degrees CW from North = 0
+  else if (adc < 990) return (270);//NOT WORKING
+  else return (-1); // error, disconnected?
+}
+
+
+//Prints the various variables directly to the port
+//I don't like the way this function is written but Arduino doesn't support floats under sprintf
+void printWeather()
+{
+  //Turn on orange led during data gathering
+  digitalWrite(STAT2, HIGH); //Turn on stat LED
+
+  //Calculates each of the variables that wunderground is expecting
+  //Calc rain now
+  float rain = get_rain();
+  dailyrainin += rain; //Each dump is RAINBUCKET of water
+  rainin += rain;//Add to this hour's amount of rain
+  //rainin_5m += rain;//Add to these 5 minutes' amount of rain
+  if(rain) Rainindi=1; else Rainindi=0; //Rain flag
+
+  //Calc winddir
+  //int winddir = get_wind_direction();
+
+  //Calc windspeed
+  //float windspeedms = get_wind_speed();
+
+  //Calc windspdms_avg2m
+  float temp = 0;
+  for(int i = 0 ; i < 120 ; i++)
+    temp += windspdavg[i];
+  temp /= 120.0;
+  float windspdms_avg2m = temp;
+
+  //Calc winddir_avg2m
+  temp = 0; //Can't use winddir_avg2m because it's an int
+  for(int i = 0 ; i < 120 ; i++)
+    temp += winddiravg[i];
+  temp /= 120;
+  int winddir_avg2m = temp;
+
+  //Calc humidity
+  //float humidity = myHumidity.readHumidity();
+  //float temp_h = myHumidity.readTemperature();
+  //Serial.print(F(" TempH:"));
+  //Serial.print(temp_h, 2);
+
+  //Calc tempc from pressure sensor
+  //float tempc = myPressure.readTemp();
+  //Serial.print(F(" TempP:"));
+  //Serial.print(tempc, 2);
+
+  //Calc pressure
+  //float pressure = myPressure.readPressure();
+
+  //Calc dewptf
+
+  //Calc light level
+  //float light_lvl = get_light_level();
+
+  //Calc battery level
+  //float batt_lvl = get_battery_level();
+  digitalWrite(STAT2, LOW); //Turn off stat LED
+//} //END OF GO CALC WEATHER FUNCTION
+
+
+  Serial.println();
+  Serial.print(gps.location.lng(), 6);
+  Serial.print(",");
+  Serial.print(gps.location.lat(), 6);
+  //Serial.print(",altitude=");
+  Serial.print(",");
+  Serial.print(gps.altitude.meters());
+  //Serial.print(",sats=");
+  Serial.print(",");
+  Serial.print(gps.satellites.value());
+
+  char sz[32];
+  Serial.print(",");
+  sprintf(sz, "%02d-%02d-%02d", gps.date.year(), gps.date.month(), gps.date.day());
+  Serial.print(sz);
+
+  //Serial.print(",time=");
+  Serial.print(",");
+  sprintf(sz, "%02d:%02d:%02d", gps.time.hour(), gps.time.minute(), gps.time.second());
+  Serial.print(sz);
+
+  //Serial.print(",winddir=");
+  Serial.print(",");
+  Serial.print(get_wind_direction());
+  //Serial.print(",windspeedms=");
+  Serial.print(",");
+  Serial.print(get_wind_speed(), 1);
+
+  //Serial.print(",windgustms=");
+  Serial.print(",");
+//  Serial.print(windgustms, 1);
+  //Serial.print(",windgustdir=");
+  Serial.print(",");
+//  Serial.print(windgustdir);
+  //Serial.print(",windspdms_avg2m=");
+  Serial.print(",");
+  Serial.print(windspdms_avg2m, 1);
+  //Serial.print(",winddir_avg2m=");
+  Serial.print(",");
+  Serial.print(winddir_avg2m);
+  //Serial.print(",windgustms_10m=");
+  Serial.print(",");
+//  Serial.print(windgustms_10m, 1);
+  //Serial.print(",windgustdir_10m=");
+  Serial.print(",");
+//  Serial.print(windgustdir_10m);
+  //Serial.print(",humidity=");
+  Serial.print(",");
+  Serial.print(myHumidity.readHumidity(), 1);
+  //Serial.print(",tempc=");
+  Serial.print(",");
+  Serial.print(myPressure.readTemp(), 1);
+
+  //Serial.print(",raindailymm=");
+  Serial.print(",");
+  Serial.print(dailyrainin, 2);
+  //Serial.print(",rainhourmm=");
+  Serial.print(",");
+  Serial.print(rainin, 2);
+
+  //Serial.print(",rain5mmm=");
+  Serial.print(",");
+  //Serial.print(rainin_5m, 2);
+  //Serial.print(",rainindicate=");
+  Serial.print(",");
+  //Serial.print(Rainindi, 1);
+
+  //Serial.print(",pressure=");
+  Serial.print(",");
+  Serial.print(myPressure.readPressure(), 2);
+
+  //Serial.print(",batt_lvl=");
+  Serial.print(",");
+  Serial.print(get_battery_level(), 2);
+
+  //Serial.print(",light_lvl=");
+  Serial.print(",");
+  Serial.print(get_light_level(), 2);
+
+  //--------------------------
+  //PRINT TO LCD
+  //--------------------------
+
+  lcd.clear();
+  lcd.print(F("Lon:"));
+  lcd.print(gps.location.lng(), 6);
+  lcd.setCursor(0, 2);
+  lcd.print(F("Lat:"));
+  lcd.print(gps.location.lat(), 6);
+  delay(5000);
+
+  lcd.clear();
+  sprintf(sz, "%02d-%02d-%02d", gps.date.year(), gps.date.month(), gps.date.day());
+  lcd.print(sz);
+  lcd.setCursor(0, 2);
+  sprintf(sz, "%02d:%02d:%02d", gps.time.hour(), gps.time.minute(), gps.time.second());
+  lcd.print(sz);
+  lcd.print(F(" GMT"));
+  delay(5000);
+
+  lcd.clear();
+  lcd.print(F("WD: "));
+  lcd.print(get_wind_direction());
+  lcd.print(F(" N=0 CW"));
+  lcd.setCursor(0, 2);
+  lcd.print(F("WS:"));
+  lcd.print(get_wind_speed(), 1);
+  lcd.print(F(" m/s"));
+  delay(5000);
+
+  lcd.clear();
+  lcd.print(F("H:"));
+  lcd.print(myHumidity.readHumidity());
+  lcd.print(F(" %"));
+  lcd.setCursor(0, 2);
+  lcd.print(F("T:"));
+  lcd.print(myPressure.readTemp());
+  lcd.print(F(" C"));
+  delay(5000);
+
+  //Not enough dynamic memory in UNO
+   lcd.clear();
+  lcd.print("R:");
+  lcd.print(dailyrainin);
+  lcd.print("(mm/d)");
+  lcd.setCursor(0, 2);
+  lcd.print(F("P:"));
+  lcd.print(myPressure.readPressure()/100.0);
+  lcd.print(F(" hPa"));
+  delay(5000);
+
+  lcd.clear();
+  lcd.print(F("R:"));
+  lcd.print(rain);
+  lcd.print(F(" mm"));
+  lcd.setCursor(0, 2);
+  lcd.print(F("5 min Raining? "));
+  if(Rainindi) lcd.print(F("Yes")); else lcd.print(F(" No"));
+  delay(5000);
+
+  //Not enough dynamic memory in UNO
+  //lcd.clear();
+  //lcd.print(F("Rain 5min (mm)"));
+  //lcd.setCursor(0, 2);
+  //lcd.print(rainin_5m);
+  //delay(2000);
+
+
+  //Not enough dynamic memory in UNO
+  lcd.clear();
+  lcd.print(F("Battery Level"));
+  lcd.setCursor(0, 2);
+  lcd.print(get_battery_level());
+  delay(2000);
+
+  //Not enough dynamic memory in UNO
+  lcd.clear();
+  lcd.print(F("Sunlight"));
+  lcd.setCursor(0, 2);
+  lcd.print(get_light_level());
+  //delay(2000);
+
+}
+


add arduino code

add arduino code

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/OnilPereyra/TPE-domotique.git/'


removed useless code

removed useless code

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/rybus/mogette-ui.git/'


Minor testing

Minor testing

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/Scalpel78/Ghost.git/'


added Arduino code - expect this to change a lot

--- OpenROV.ino
+++ OpenROV.ino
@@ -0,0 +1,115 @@
+#include <Servo.h>
+
+void rov_analog_write();
+
+Servo tilt, light, port, vertical, starbord;
+
+int speed_offset = 31, l = 0, MIDPOINT = 128,
+    p = MIDPOINT, v = MIDPOINT, s = MIDPOINT, t = MIDPOINT;
+
+int count;
+
+void setup(){
+
+  Serial.begin(9600);
+
+  tilt.attach(5);
+  light.attach(6);
+  port.attach(9);
+  vertical.attach(10);
+  starbord.attach(11);
+
+  count = 0;
+}
+
+void loop(){
+  // ========================================================================================
+  // ========================================================================================
+  // Get commands from OpenROV
+  // ========================================================================================
+  // ========================================================================================
+
+  if (Serial.available()) {
+    delay(30); // number of characters to be read?  buffer delay (TODO:  affects timing of sensors... fix this?)
+    String cmd = "";
+    char in;
+    while(Serial.available() > 0) { // read full string
+      in = Serial.read();
+      if (in == ';') break;
+      cmd += in;  // concat each char to string
+    }
+
+    // Parse command from Beaglebone
+    if      (cmd == "move_up") { vertical.write(MIDPOINT + speed_offset); }
+    else if (cmd == "move_down") { vertical.write(MIDPOINT - speed_offset); }
+    else if (cmd == "move_forward") { port.write(MIDPOINT + speed_offset); starbord.write(MIDPOINT + speed_offset); }
+    else if (cmd == "move_aft") { port.write(MIDPOINT - speed_offset); starbord.write(MIDPOINT - speed_offset); }
+    else if (cmd == "rotate_left") { port.write(MIDPOINT - speed_offset); starbord.write(MIDPOINT + speed_offset); }
+    else if (cmd == "rotate_right") { port.write(MIDPOINT + speed_offset); starbord.write(MIDPOINT - speed_offset); }
+    else if (cmd.startsWith("throttle(")) {
+      cmd.replace("throttle(", "");
+      cmd.replace(")", "");
+      speed_offset = atoi(&cmd[0]);
+    }
+    else if (cmd.startsWith("go(")) {
+      cmd.replace("go(", "");
+      cmd.replace(")", "");
+
+      int portVal = MIDPOINT, starbordVal = MIDPOINT, verticalVal = MIDPOINT;
+      String servoVal = "";
+      int nextPort = 0;
+      String temp;
+
+      for (int i = 0; i < cmd.length(); i++){
+        temp = (char*)cmd[i];
+        if      (temp != ","){ servoVal += temp; }
+        else if (nextPort == 0) { portVal = atoi(&servoVal[0]); nextPort++; servoVal = ""; }
+        else if (nextPort == 1) { starbordVal = atoi(&servoVal[0]); nextPort++; servoVal = ""; }
+      }
+      verticalVal = atoi(&servoVal[0]);
+
+      port.write(portVal);
+      vertical.write(verticalVal);
+      starbord.write(starbordVal);
+
+    }
+    else {port.write(MIDPOINT); vertical.write(MIDPOINT); starbord.write(MIDPOINT); }  // stop
+
+    //Serial.println(cmd);
+  }
+
+  // ========================================================================================
+  // ========================================================================================
+  // Write commands to OpenROV
+  // ========================================================================================
+  // ========================================================================================
+
+  // TODO: make these actually do something, just testing for now
+  // once every 1,300 counts
+  if (count % 1300 == 0){
+    rov_analog_output(1, "float");
+  }
+  // once every 10,000 counts
+  if (count == 10000){
+    rov_analog_output(0, "salinity");
+    count = 0;  // reset counter (this should be done by the longest "running" counter
+  }
+  count++;
+}
+
+// Actually create and send command
+// Example:  rov_analog_output(0, "salinity");
+// outputs:  salinity:124;
+void rov_analog_output(int pin, String cmd){
+  cmd += ":";    // separates command and value
+  char cmd_output[50];
+  cmd.toCharArray(cmd_output, 50);
+  int pin_read = analogRead(pin);
+  String pin_read_str = String(pin_read);
+  char out[5];
+  pin_read_str.toCharArray(out, 5);
+
+  Serial.write(cmd_output);
+  Serial.write(out);
+  Serial.write(";");    // command delimiter
+}


Add example for storing JSON config file in SPIFFS

error: pathspec 'hardware/esp8266com/esp8266/libraries/esp8266/examples/ConfigFile/ConfigFile.ino' did not match any file(s) known to git

--- hardware/esp8266com/esp8266/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
+++ hardware/esp8266com/esp8266/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
@@ -0,0 +1,97 @@
+// Example: storing JSON configuration file in flash file system
+//
+// Uses ArduinoJson library by Benoit Blanchon.
+// https://github.com/bblanchon/ArduinoJson
+//
+// Created Aug 10, 2015 by Ivan Grokhotkov.
+//
+// This example code is in the public domain.
+
+#include <ArduinoJson.h>
+#include "FS.h"
+
+bool loadConfig() {
+  File configFile = SPIFFS.open("/config.json", "r");
+  if (!configFile) {
+    Serial.println("Failed to open config file");
+    return false;
+  }
+
+  size_t size = configFile.size();
+  if (size > 1024) {
+    Serial.println("Config file size is too large");
+    return false;
+  }
+
+  // Allocate a buffer to store contents of the file.
+  std::unique_ptr<char[]> buf(new char[size]);
+
+  // We don't use String here because ArduinoJson library requires the input
+  // buffer to be mutable. If you don't use ArduinoJson, you may as well
+  // use configFile.readString instead.
+  configFile.readBytes(buf.get(), size);
+
+  StaticJsonBuffer<200> jsonBuffer;
+  JsonObject& json = jsonBuffer.parseObject(buf.get());
+
+  if (!json.success()) {
+    Serial.println("Failed to parse config file");
+    return false;
+  }
+
+  const char* serverName = json["serverName"];
+  const char* accessToken = json["accessToken"];
+
+  // Real world application would store these values in some variables for
+  // later use.
+
+  Serial.print("Loaded serverName: ");
+  Serial.println(serverName);
+  Serial.print("Loaded accessToken: ");
+  Serial.println(accessToken);
+  return true;
+}
+
+bool saveConfig() {
+  StaticJsonBuffer<200> jsonBuffer;
+  JsonObject& json = jsonBuffer.createObject();
+  json["serverName"] = "api.example.com";
+  json["accessToken"] = "128du9as8du12eoue8da98h123ueh9h98";
+
+  File configFile = SPIFFS.open("/config.json", "w");
+  if (!configFile) {
+    Serial.println("Failed to open config file for writing");
+    return false;
+  }
+
+  json.printTo(configFile);
+  return true;
+}
+
+void setup() {
+  Serial.begin(115200);
+  Serial.println("");
+  delay(1000);
+  Serial.println("Mounting FS...");
+
+  if (!SPIFFS.begin()) {
+    Serial.println("Failed to mount file system");
+    return;
+  }
+
+
+  if (!saveConfig()) {
+    Serial.println("Failed to save config");
+  } else {
+    Serial.println("Config saved");
+  }
+
+  if (!loadConfig()) {
+    Serial.println("Failed to load config");
+  } else {
+    Serial.println("Config loaded");
+  }
+}
+
+void loop() {
+}


to command motors for windows or shutter

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

--- Python_MQTT2Arduino/arduinoWindow1/arduinoWindow1.ino
+++ Python_MQTT2Arduino/arduinoWindow1/arduinoWindow1.ino
@@ -0,0 +1,289 @@
+#define LOG_DEBUG(str)   Serial.println(str)
+#define LOG_ERROR(str)   Serial.println(str)
+
+#include "msgFromMQTT.h"
+String sketchFullName = __FILE__;
+
+
+#define PIN_MOT_A     3
+#define PIN_MOT_B     5
+#define PIN_MOT_C     6
+#define PIN_MOT_D     9
+stListPin listPin[] = {
+  stListPin(PIN_MOT_A,    "moteur1"),
+  stListPin(PIN_MOT_B,    "moteur2"),
+  stListPin(PIN_MOT_C,    "moteur3"),
+  stListPin(PIN_MOT_D,    "moteur4")
+};
+int listPinSize = sizeof(listPin) / sizeof(stListPin);
+
+
+// list of available commands (user) that the arduino will accept
+int switchMoteur1(const String& dumb);
+int switchMoteur2(const String& dumb);
+int switchMoteur3(const String& dumb);
+int switchMoteur4(const String& dumb);
+int settingMoteurs(const String& dumb);
+
+// list of available commandes (system ctrl) that the arduino will accept
+// example:  int sendSketchId(const String& dumb);
+
+// list of available commands (user) that the arduino will accept
+Commande cmdos[] = {
+  Commande("moteur1/switch",  &switchMoteur1),
+  Commande("moteur2/switch",  &switchMoteur2),
+  Commande("moteur3/switch",  &switchMoteur3),
+  Commande("moteur4/switch",  &switchMoteur4),
+  Commande("moteur/setting",  &settingMoteurs)
+};
+int cmdosSize = sizeof(cmdos) / sizeof(Commande);
+
+// list of available commands (system ctrl) that the arduino will accept
+Commande cmds[] = {
+  Commande("idSketch",  &sendSketchId),
+  Commande("idBuild",   &sendSketchBuild),
+  Commande("listCmdAT", &sendListCmdAT),
+  Commande("listCmdDO", &sendListCmdDO),
+  Commande("listPin",   &sendListPin),
+  Commande("pinMode",   &cmdPinMode),
+  Commande("pinRead",   &cmdPinRead),
+  Commande("pinWrite",  &cmdPinWrite)
+};
+int cmdsSize = sizeof(cmds) / sizeof(Commande);
+
+
+int switchMoteurAny(const String& sOnOff, const int numMoteur);
+
+struct Moteur  {
+  int stateUpDown;       // 1 /  -1
+  int actionUpDownNone;  // 1 / 0 / -1
+  long timeEndAction;
+  int valStill;
+  int valUp;
+  int valDown;
+  int periodUp;
+  int periodDown;
+  int pin;
+  void up();
+  void down();
+  Moteur (int vs, int peru, int perd): stateUpDown(-1), actionUpDownNone(0),
+      timeEndAction(0), valStill(vs), valUp(vs+20), valDown(vs-20),
+      periodUp(peru), periodDown(perd)   {}
+};
+
+void moteurCheck();
+
+Moteur moteurs[] = {
+  Moteur(100, 1000, 1000),
+  Moteur(100, 1000, 1000),
+  Moteur(100, 1000, 1000),
+  Moteur(100, 1000, 1000),
+  Moteur(100, 1000, 1000),
+  Moteur(100, 1000, 1000),
+  Moteur(100, 1000, 1000),
+  Moteur(100, 1000, 1000)
+};
+const int NBMOT = sizeof(moteurs) / sizeof(Moteur);
+
+/*---------------------------------------------------------------*/
+/*                setup and loop function                        */
+/*---------------------------------------------------------------*/
+
+void setup()
+{
+    for (int i=0; i<NBMOT; i++)
+        pinMode(moteurs[i].pin, OUTPUT);
+
+    Serial.begin(9600);
+    inputMessage.reserve(200);
+
+    // I send identification of sketch
+    sendSketchId("");
+    sendSketchBuild("");
+    sendListPin("");
+}
+
+void loop()
+{
+  checkMessageReceived();
+
+  // because of bad communication, some message may be stucked in
+  //   serial buffer. If so, we trace it
+  checkNoStuckMessageInBuffer();
+
+  // blink Led. blink time is set with external cmd ledBlinkTime
+  //blinkLed();
+
+  // check and update the movement of moteurs
+  moteurCheck();
+
+  // I slow down Arduino
+  delay(10);
+}
+
+
+void serialEvent()
+{
+  serialEventMFMQTT();
+}
+
+/*---------------------------------------------------------------*/
+/*                  list of user function                        */
+/*---------------------------------------------------------------*/
+
+void moteurCheck()
+{
+  long now = millis();
+  for (int im=0; im<NBMOT; im++)
+  {
+    // update action
+    if (now > moteurs[im].timeEndAction)   {
+      // I update position state
+      if (moteurs[im].actionUpDownNone == -1)   // down
+          moteurs[im].stateUpDown = -1;
+      else if (moteurs[im].actionUpDownNone == 1)   // up
+          moteurs[im].stateUpDown = 1;
+
+      moteurs[im].actionUpDownNone = 0;   // no action
+    }
+
+    // I send value corresponding to action
+    if (moteurs[im].actionUpDownNone == -1)   // DOWN
+      analogWrite(moteurs[im].pin, moteurs[im].valDown);
+    else if (moteurs[im].actionUpDownNone == 1)   // UP
+      analogWrite(moteurs[im].pin, moteurs[im].valUp);
+    else   //  actionUpDownNone == nothing
+      analogWrite(moteurs[im].pin, moteurs[im].valStill);
+  }
+}
+
+// switch the roller shutter ( or  window ) up or down
+// this function is common to anyone
+int switchMoteurAny(const String& sOnOff, const int numMoteur)
+{
+    // sOnOff contains cmd and value with this format cmd:value
+    // value must exist
+    int ind = sOnOff.indexOf(":");
+    if (ind < 0)   {
+      LOG_ERROR(F("switchMoteur cmd needs 1 value"));
+      String msg2py = msg2pyStart + sOnOff + "/KO" + msg2pyEnd;
+      Serial.print(msg2py);
+      return 1;
+    }
+
+    // we get cmd part
+    String command = sOnOff.substring(0, ind);
+    // we get value part
+    String sValue = sOnOff.substring(ind+1);
+    // value must be  UP  or  DOWN
+    if ( ( ! sValue.equals("UP")) && ( ! sValue.equals("DOWN")) )   {
+      LOG_ERROR(command+ F(": value must be UP or DOWN"));
+      String msg2py = msg2pyStart + command + F("/KO") + msg2pyEnd;
+      Serial.print(msg2py);
+      return 2;
+    }
+
+    // commands motors
+    if (sValue.equals("UP"))
+      moteurs[numMoteur].up();
+    else if (sValue.equals("DOWN"))
+      moteurs[numMoteur].down();
+    else
+      Serial.println ("jamais de la vie");
+
+    // I send back OK msg
+    String msg2py = msg2mqttStart + command + F("/OK:") + sValue + msg2pyEnd;
+    Serial.print(msg2py);
+    // I send back state msg
+    msg2py = msg2mqttStart + F("moteur")+numMoteur+F("/etat:") + sValue + msg2pyEnd;
+    Serial.print(msg2py);
+
+    return 0;
+}
+
+// switch the moteur up or down
+int switchMoteur1(const String& sOnOff)
+{
+    return switchMoteurAny(sOnOff, 1);
+}
+
+int switchMoteur2(const String& sOnOff) { return switchMoteurAny(sOnOff, 2); }
+int switchMoteur3(const String& sOnOff) { return switchMoteurAny(sOnOff, 3); }
+int switchMoteur4(const String& sOnOff) { return switchMoteurAny(sOnOff, 4); }
+int switchMoteur5(const String& sOnOff) { return switchMoteurAny(sOnOff, 5); }
+int switchMoteur6(const String& sOnOff) { return switchMoteurAny(sOnOff, 6); }
+int switchMoteur7(const String& sOnOff) { return switchMoteurAny(sOnOff, 7); }
+int switchMoteur8(const String& sOnOff) { return switchMoteurAny(sOnOff, 8); }
+
+
+// set value for moteurs
+int settingMoteurs(const String& aCmdVal)
+{
+    // input arg  contains cmd and value with this format cmd:value
+    // value must exist
+    int ind = aCmdVal.indexOf(":");
+    if (ind < 0)   {
+      LOG_ERROR(F("moteurSetting cmd needs 4 values: mot:still:perup:perdown"));
+      String msg2py = msg2pyStart + aCmdVal + "/KO" + msg2pyEnd;
+      Serial.print(msg2py);
+      return 1;
+    }
+
+    // we get cmd part
+    String command = aCmdVal.substring(0, ind);
+    // we get value part
+    String sValue = aCmdVal.substring(ind+1);
+    for (int i=0; i<4; i++)   {
+      // value must be an int
+      int iValue1 = sValue.toInt();
+      // toInt will return 0, if it is not an int
+      if ( (iValue1 == 0) && ( ! sValue.equals("0")) )   {
+        LOG_ERROR(command+ F(": value mot 1 must be integer"));
+        String msg2py = msg2pyStart + command + F("/KO") + msg2pyEnd;
+        Serial.print(msg2py);
+        return 2;
+      }
+      else if ((iValue1 < 0) || (100 < iValue1))   {
+        LOG_ERROR(command+ F(": value 1 must be between 0 and 100"));
+        String msg2py = msg2pyStart + command + F("/KO") + msg2pyEnd;
+        Serial.print(msg2py);
+        return 3;
+      }
+    }
+
+    // converts iValue1 0/100  to  iValue PWM 0/255
+    int iValue = int(iValue1 * 2.55);
+
+    analogWrite(PIN_MOT_A, iValue);
+
+    // I send back OK msg
+    String msg2py = msg2mqttStart + command + F("/OK:") + sValue + msg2pyEnd;
+    Serial.print(msg2py);
+    // I send back state msg
+    msg2py = msg2mqttStart + F("lumiere/etat:") + sValue + msg2pyEnd;
+    Serial.print(msg2py);
+
+    return 0;
+}
+
+// trigger action upward
+void Moteur::up()   {
+  // we return immediately if it was already UP (for fear of echo)
+  if (actionUpDownNone == 1)
+      return;
+
+  actionUpDownNone = 1;
+  // the first time, it sets time of end
+  timeEndAction = millis() + periodUp;
+}
+// trigger action downward
+void Moteur::down()   {
+  // we return immediately if it was already UP (for fear of echo)
+  if (actionUpDownNone == -1)
+      return;
+
+  actionUpDownNone = -1;
+  // the first time, it sets time of end
+  timeEndAction = millis() + periodDown;
+}
+


Add: add steering receive using CAN.

Add: add steering receive using CAN.

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

--- arduino/receive_steering_CAN/receive_steering_CAN.ino
+++ arduino/receive_steering_CAN/receive_steering_CAN.ino
@@ -0,0 +1,69 @@
+// demo: CAN-BUS Shield, receive data with check mode
+// send data coming to fast, such as less than 10ms, you can use this way
+// loovee, 2014-6-13
+
+
+#include <SPI.h>
+#include "mcp_can.h"
+
+
+// the cs pin of the version after v1.1 is default to D9
+// v0.9b and v1.0 is default D10
+const int SPI_CS_PIN = 9;
+
+MCP_CAN CAN(SPI_CS_PIN);                                    // Set CS pin
+
+void setup()
+{
+    Serial.begin(115200);
+
+    while (CAN_OK != CAN.begin(CAN_500KBPS))              // init can bus : baudrate = 500k
+    {
+        Serial.println("CAN BUS Shield init fail");
+        Serial.println(" Init CAN BUS Shield again");
+        delay(100);
+    }
+    Serial.println("CAN BUS Shield init ok!");
+}
+
+
+void loop()
+{
+    unsigned char len = 0;
+    unsigned char buf[5];
+    unsigned char first_byte = 0x0000;
+    unsigned char second_byte = 0x0000;
+
+    int steer_angle = 0x0000;
+
+    if(CAN_MSGAVAIL == CAN.checkReceive())            // check if data coming
+    {
+        CAN.readMsgBuf(&len, buf);    // read data,  len: data length, buf: data buf
+
+        unsigned int canId = CAN.getCanId();
+
+        Serial.println("-----------------------------");
+        Serial.print("Get data from ID: ");
+        Serial.println(canId, HEX);
+
+        for(int i = 0; i<len; i++)    // print the data
+        {
+            Serial.print(buf[i], HEX);
+            Serial.print("\t");
+        }
+        first_byte = buf[1];
+        second_byte = buf[0];
+
+        steer_angle = (first_byte << 8) | second_byte;
+        Serial.print("angle_hex = ");
+        Serial.print(steer_angle, HEX);
+        Serial.print("  angle = ");
+        Serial.println(steer_angle, DEC);
+
+        Serial.println();
+    }
+}
+
+/*********************************************************************************************************
+  END FILE
+*********************************************************************************************************/


Added example for debug print.

Added example for debug print.

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


Testing Feedback Hack on Servos

Testing Feedback Hack on Servos

DOES NOT WORK
If servo is mechanically stalled, the potentiometer still reads as
anticipated

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

--- ServoFeedback/ServoFeedback.ino
+++ ServoFeedback/ServoFeedback.ino
@@ -0,0 +1,47 @@
+/* Sweep
+ by BARRAGAN <http://barraganstudio.com>
+ This example code is in the public domain.
+
+ modified 8 Nov 2013
+ by Scott Fitzgerald
+ http://arduino.cc/en/Tutorial/Sweep
+*/
+
+#include <Servo.h>
+#include <Filter.h>
+
+Servo myservo;  // create servo object to control a servo
+                // twelve servo objects can be created on most boards
+
+int pos = 0;    // variable to store the servo position
+int dpos = 1;
+long int count = 0;
+unsigned long prev = 0;
+
+Filter<uint16_t> w(100);
+
+void setup()
+{
+  Serial.begin(9600);
+  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
+}
+
+void loop()
+{
+  unsigned long ms = millis();
+  w.push(analogRead(A0));
+  count++;
+  if ( ms - prev > 15 )
+  {
+    Serial.print(pos);
+    Serial.print('\t');
+    Serial.println(w.mean());
+    if(pos == 0) dpos = 1;
+    else if (pos == 180) dpos = -1;
+    pos = pos+dpos;
+    prev = millis();
+    myservo.write(pos);
+    count = 0;
+  }
+}
+


Create possible2.ino

Create possible2.ino

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

--- spark-as-client/possible2.ino
+++ spark-as-client/possible2.ino
@@ -0,0 +1,79 @@
+#include <string.h>
+char server[] = "bstolte.com";
+TCPClient client;
+
+int ledPin = D5;                 // choose the pin for the LED
+int inputPin = D7;               // choose the input pin (for PIR sensor)
+int pirState = LOW;              // we start, assuming no motion detected
+int val = 0;                     // variable for reading the pin status
+int count;  // print out to serial the number of times it's going through the loop
+
+
+int getrequest();
+
+void setup() {
+    pinMode(ledPin, OUTPUT);     // set up the LED as an output, it will light up if motion is detected
+    pinMode(inputPin, INPUT);    // read the input from the PIR sensor
+    Spark.variable("inputPin", &inputPin, INT);  // Register the Spark variable for use with the API
+
+    Serial.begin(9600);
+    delay(1000);
+    Serial.println("connecting...");
+}
+
+
+void loop() {
+
+    val = digitalRead(inputPin);  // read the value from the PIR sensor
+    if (val == HIGH) {
+        digitalWrite (ledPin, HIGH);  //Turn on the LED
+        delay(300);  // wait for 300ms
+        getrequest(); //send to server
+
+        if (pirState == LOW) {                     // we have turned on so let's let the serial monitor know
+            Serial.println("Motion detected!");
+            pirState = HIGH;                       // set it to high
+        }
+    }
+    else {
+        digitalWrite (ledPin, LOW);                // turn the LED off
+        delay(300);                                // wait again for 300ms
+        if (pirState == HIGH) {                     // we have just turned off
+            Serial.println("Motion ended!");
+            pirState = LOW;
+            count = 0;  // reset the counter
+        }
+    }
+
+
+
+}
+
+int getrequest(){
+    client.connect(server, 80);
+
+    if (client.connected()) {
+            Serial.println("Connected");
+            client.println("GET /motion_sms/sendsms/4154256133/home-alert HTTP/1.0");
+            client.print("Host: ");
+            client.println(server);
+            client.println("Connection: close"); //just added
+            client.println();
+            client.flush();
+            client.stop();
+            return 1;
+         }
+        else {
+            client.flush();
+            client.stop();
+            Serial.println("Not connected");
+            return 0;
+        }
+}
+
+
+ /*
+if (client.available()) {
+client.flush();
+}
+*/


Created sonar_distance.ino to get distance using sonar sensor

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/lolisa/2014-15.git/'


Update Templete.ino

Update Templete.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/SirenCreatorTeam/Siren_Zwei.git/'


Nightly

Nightly

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/rniemand/ArduinoProjects.git/'


pulse counting code

pulse counting code

Here's the code I have so far. It counts the pulses for a 10 second
period, and then computes the number of pulses per minute.


Refactor sha1 calculation/comparison

Refactor sha1 calculation/comparison

Signed-off-by: Edi Permadi <163b49ac0c44ca5b49677bf42f3f8680b3bd9867@gmail.com>

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/edipermadi/teensy-hsm.git/'


initial add, use this for EthernetServer verification

error: pathspec 'hardware/lm4f/variants/launchpad_129/tests/TestEthernetServer/TestEthernetServer.ino' did not match any file(s) known to git

--- hardware/lm4f/variants/launchpad_129/tests/TestEthernetServer/TestEthernetServer.ino
+++ hardware/lm4f/variants/launchpad_129/tests/TestEthernetServer/TestEthernetServer.ino
@@ -0,0 +1,40 @@
+#include <Ethernet.h>
+
+byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
+IPAddress ip(192,168,1,177);
+
+EthernetServer server(23);
+
+void setup() {
+  Serial.begin(9600);
+  Serial.println("\nTestEthernetServer setup");
+  Ethernet.begin(mac, ip);
+  server.begin();
+  Serial.print("ip:port ");
+  Serial.print(Ethernet.localIP());
+  Serial.println(":23");
+}
+
+
+void loop() {
+  EthernetClient client = server.available();
+  if (client) {
+    client.println("Welcome");
+    boolean currentLineIsBlank = true;
+    while (client.connected()) {
+      if (client.available()) {
+        char c = client.read();
+        Serial.write(c);
+        if (c == 'x') {
+          client.println("Bye");
+          delay(100);
+          client.stop();
+          break;
+        }
+      }
+    }
+    delay(1);
+    client.stop();
+  }
+}
+


Changed KEEP_ALIVE_INTERVAL to 2 seconds. This will give the host more time to send the message.

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/RichoM/Uzi.git/'


Example Code

Example Code

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

--- SensorSketch/SensorSketch.ino
+++ SensorSketch/SensorSketch.ino
@@ -0,0 +1,16 @@
+#include <SensorTool.h>
+
+Sensor SensorList[2] =
+{
+  Sensor(A0, Analog),
+  Sensor(7, Digital)
+};
+void setup() {
+  Serial.begin(9600);
+}
+
+void loop() {
+  int sensorValue = SensorList[0].Read();
+  Serial.println(sensorValue);
+  delay(500);
+}


Added files via upload

Added files via upload

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

--- Motor_Test.ino
+++ Motor_Test.ino
@@ -0,0 +1,45 @@
+
+//int switchPin = 12; // Pin for switch
+int motor1Pin1 = 2; // left backwards (white wire)
+int motor1Pin2 = 3; // left forwards (brown wire)
+int motor2Pin2 = 4; // right backwards (red wire)
+int motor2Pin1 = 5; // right forwards (black wire)
+
+
+void setup() {
+  //pinMode(switchPin, INPUT);
+  pinMode(motor1Pin2, OUTPUT);
+  pinMode(motor1Pin1, OUTPUT);
+  pinMode(motor2Pin2, OUTPUT);
+  pinMode(motor2Pin1, OUTPUT);
+
+  Serial.begin(9600);
+  //digitalWrite(motor1Pin1, HIGH);
+  //digitalWrite(motor1Pin2, HIGH);
+  //digitalWrite(motor2Pin1, HIGH);
+  //digitalWrite(motor2Pin2, HIGH);
+}
+
+void loop() {
+  // put your main code here, to run repeatedly:
+  digitalWrite(motor1Pin1, HIGH);    //motor 1 will go forward then delay for 1 second
+  digitalWrite(motor1Pin2, LOW);
+  digitalWrite(motor2Pin1, LOW);
+  digitalWrite(motor2Pin2, LOW);
+  delay(2000);
+  digitalWrite(motor1Pin1, LOW);
+  digitalWrite(motor1Pin2, HIGH);    //motor 1 will go backward then delay for 1 second
+  digitalWrite(motor2Pin1, LOW);
+  digitalWrite(motor2Pin2, LOW);
+  delay(2000);
+  digitalWrite(motor1Pin1, LOW);
+  digitalWrite(motor1Pin2, LOW);
+  digitalWrite(motor2Pin1, HIGH);    //motor 2 will go forward then delay for 1 second
+  digitalWrite(motor2Pin2, LOW);
+  delay(2000);
+  digitalWrite(motor1Pin1, LOW);
+  digitalWrite(motor1Pin2, LOW);
+  digitalWrite(motor2Pin1, LOW);
+  digitalWrite(motor2Pin2, HIGH);    //motor 2 will go backward then delay for 1 second
+  delay(2000);
+}


Added Indicator Lights

Added Indicator Lights

Added indicator lights for set up / GPS fix / status as well as fixed
GPS fix timeout.

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/'


Add files via upload

Add files via upload

A variety of different ways to blink a pixel using FastLED.

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

--- blink_variations.ino
+++ blink_variations.ino
@@ -0,0 +1,267 @@
+//***************************************************************
+// Blink some pixels on and off.
+// A variety of different ways to blink individual pixels.
+// Something you might use for a beacon or indicator light or
+// put in a spaceship model kit.
+//
+// Some are more straight forward then others.  Just having fun
+// making up a variety of ways to blink a pixel.
+//
+// Be aware that pixel numbers are hard coded in these examples.
+// Change as needed for your setup.
+//
+// Marc Miller, Aug 2021
+//***************************************************************
+
+
+#include "FastLED.h"
+#define DATA_PIN    11
+#define CLOCK_PIN   13
+#define LED_TYPE    LPD8806
+#define COLOR_ORDER GRB
+#define NUM_LEDS    32
+#define BRIGHTNESS  128
+CRGB leds[NUM_LEDS];
+
+
+//---------------------------------------------------------------
+void setup() {
+  Serial.begin(115200);  // Allows serial monitor output
+  delay(1500); // startup delay
+  FastLED.addLeds<LED_TYPE,DATA_PIN,CLOCK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
+  FastLED.setBrightness(BRIGHTNESS);
+  FastLED.clear();
+  FastLED.show();
+  Serial.println("\nSetup done. \n");
+}
+
+
+//---------------------------------------------------------------
+void loop() {
+
+
+  EVERY_N_MILLISECONDS(1200) {  // change the state every 1200ms
+    static boolean ps0;  // stores the pixel state
+    ps0 = !ps0;  // toggle on/off state
+    if (ps0 == 1) {
+      leds[0] = CRGB::Yellow;
+    } else {
+      leds[0] = CRGB::Black;
+    }
+  }
+
+
+
+  EVERY_N_MILLISECONDS(400) {
+    // Is the pixel on?
+    if ( leds[1] ) {
+      // yes, then turn it off
+      leds[1] = CRGB(0,0,0);
+    } else {
+      // no, then turn it on
+      leds[1] = CRGB::Green;
+    }
+  }
+
+
+
+  // A blink with uneven on/off times
+  EVERY_N_MILLISECONDS(333) {
+    static boolean stateA = 0;
+    static boolean stateB = 1;
+    stateA = !stateA;
+    if (stateA == 1) {
+      stateB = !stateB;
+    }
+    if (stateA && stateB) {
+      leds[2] = CHSV(210,220,255);
+    } else {
+      leds[2] = CHSV(192,255,140);
+    }
+  }
+
+
+
+  // A three state blink
+  EVERY_N_MILLISECONDS(250) {
+    static uint8_t ps2;
+    if (ps2 < 4) {
+      leds[3] = CRGB::Black;
+    } else {
+      if ( ps2 % 2 == 0) {
+        leds[3] = CRGB::Aqua;
+      } else {
+        leds[3] = CRGB::Blue;
+      }
+    }
+    ps2++;
+    if (ps2 == 9) { ps2 = 0; }  // reset
+  }
+
+
+
+  // Several experiments with variable timmers
+
+
+  // This is a fun pattern that uses two pixels next to eachother.
+  static boolean pMode = 0;
+  static boolean flip = 0;
+  EVERY_N_MILLISECONDS_I( timingA, 1) {
+    // This initally defaults to 1 millisecond, but then will
+    // imediately use the timingA.setPeriod times below.
+    // You can name "timingA" anything you want.
+    pMode = !pMode;
+    if (pMode) {
+      timingA.setPeriod(450);
+    } else {
+      timingA.setPeriod(1400);
+    }
+  }
+  EVERY_N_MILLISECONDS(40) {
+    if (pMode) {
+      flip = !flip;
+      if (flip) {
+        leds[4] = CHSV(55,160,200);
+        leds[5] = CHSV(0,0,0);
+      } else {
+        leds[4] = CHSV(0,0,0);
+        leds[5] = CHSV(55,160,200);
+      }
+    } else {
+      leds[4] = CHSV(0,0,0);
+      leds[5] = CHSV(0,0,0);
+    }
+  }
+
+
+
+  static boolean blink6;
+  // vary the setPeriods to change on/off times
+  EVERY_N_MILLISECONDS_I(timingB,1) {
+    blink6 = !blink6;
+  }
+  if (blink6 == 1) {
+    leds[6] = CRGB::Red;
+    timingB.setPeriod(750);  // On time
+  } else {
+    leds[6] = CRGB::Black;
+    timingB.setPeriod(250);  // Off time
+  }
+
+
+
+  // blink with a fadeout
+  static boolean pulse = 0;
+  EVERY_N_MILLISECONDS_I( timingFade, 1) {
+    pulse = !pulse;
+    if (pulse) {
+      timingFade.setPeriod(700);  // time to hold before fading
+      leds[7] = CHSV(40, 245, 255);
+    } else {
+      timingFade.setPeriod(1000);
+    }
+  }
+  if (pulse == 0) {
+    EVERY_N_MILLISECONDS(10) {
+      leds[7].fadeToBlackBy(12);  // fade out
+    }
+  }
+
+
+
+  // This one is probably overly complicated, but it came
+  // from an older project where I needed to make a very
+  // specific blink pattern.
+  static boolean blinkState = LOW;
+  static boolean blinkGate1 = LOW;
+  static boolean blinkGate2 = HIGH;
+  static int8_t blinkCount = -1;
+  EVERY_N_MILLISECONDS_I(timingDbl, 500) {
+    blinkCount++;
+    if (blinkCount == 6) { blinkCount = 0; }  // reset count
+    blinkGate2 = blinkCount;
+    blinkState = !blinkState;
+    blinkGate1 = !blinkGate1;
+    if (blinkCount == 2 || blinkCount == 3) {
+      timingDbl.setPeriod( 50 );
+    } else if (blinkCount == 4) {
+      timingDbl.setPeriod( 405 );
+    } else {
+      timingDbl.setPeriod( 167 );
+    }
+    // leds8 is the original blink pattern
+    // leds9 is an interesting alternate version
+    if (blinkState * blinkGate1 * blinkGate2) {
+      leds[8] = CHSV(0,230,200);  // The original red blink
+      leds[9] = CRGB::Black;
+    } else {
+      leds[8] = CHSV(0,0,0);
+      leds[9] = CHSV(0,0,200);
+    }
+  }
+  if (blinkCount == 5) {
+    leds[9] = CHSV(0,0,0);
+  }
+
+
+
+
+  // Driving on/off with wave functions
+
+  // Blinks with some ramping. Change bpm to change speed
+  uint8_t valueBS = beatsin8(60,0,255);  // (bpm, low, high)
+  if (valueBS > 50) {
+    leds[10] = CHSV(100,170,valueBS);
+  } else {
+    leds[10] = CRGB::Black;
+  }
+  if (valueBS > 180) {
+    leds[11] = CHSV(180,65,valueBS);
+  } else {
+    leds[11] = CRGB::Black;
+  }
+
+
+
+  uint8_t valueTW = triwave8(millis()/4);  // Divide millis by more or less to change speed.
+  if (valueTW > 30) {  // The pixel will mostly be On.
+    leds[12] = CHSV(150,255,255);
+  } else {
+    leds[12] = CRGB::Black;
+  }
+  if (valueTW > 230) {  // An inverted version where pixel will mostly be Off.
+    leds[13] = CRGB::Yellow;
+  } else {
+    leds[13] = CRGB::Black;
+  }
+
+
+
+  // This was pleasingly simple.  Divide millis by more or less to change speed.
+  uint8_t valueSW = squarewave8(millis()/6, 128);  // (input, pulsewidth[0-255])
+  leds[14] = CHSV(120,255,valueSW);
+
+
+
+  // This blink speeds up and then slows back down.
+  static boolean blinkUp;
+  const uint16_t bSlow = 350;
+  const uint16_t bFast = 50;
+  uint16_t bCurrent = beatsin16(5,0,65535);
+  bCurrent = map(bCurrent,0,65535,bFast,bSlow);
+  EVERY_N_MILLISECONDS_I(timingUp,bSlow) {
+    blinkUp = !blinkUp;
+    timingUp.setPeriod(bCurrent);
+  }
+  if (blinkUp == 1) {
+    leds[15] = CHSV(160,145,200);
+  } else {
+    leds[15] = CRGB::Black;
+  }
+
+
+
+  FastLED.show();
+
+  delay(1);  // this can be deleted as needed
+}


Added pokeball

Added pokeball

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/estefanniegg/estefannieExplainsItAll.git/'


Update pt_remote controlled car2.ino

Update pt_remote controlled car2.ino

error: pathspec 'pt_remote' did not match any file(s) known to git
error: pathspec 'controlled' did not match any file(s) known to git
error: pathspec 'car/pt_remote' did not match any file(s) known to git
error: pathspec 'controlled' did not match any file(s) known to git
error: pathspec 'car2.ino' did not match any file(s) known to git


Increased output delays so I can record numbers by hand.

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


preparing for moving machines

preparing for moving machines

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

--- hbridge2wlights/hbridge2wlights.ino
+++ hbridge2wlights/hbridge2wlights.ino
@@ -0,0 +1,51 @@
+int RTLpin = 23;
+int RTRpin = 22;
+//int LTLpin = 21;
+//int LTRpin = 20;
+//int LBLpin = 16;
+//int LBRpin = 15;
+int RBLpin = 14;
+int RBRpin = 13;
+int delayspd = 1000;
+int spinspd = 256;
+
+void setup(){
+  pinMode(RTLpin, OUTPUT);
+  pinMode(RTRpin, OUTPUT);
+//  pinMode(LTLpin, OUTPUT);
+//  pinMode(LTRpin, OUTPUT);
+//  pinMode(LBLpin, OUTPUT);
+//  pinMode(LBRpin, OUTPUT);
+  pinMode(RBLpin, OUTPUT);
+  pinMode(RBRpin, OUTPUT);
+}
+
+void loop() {
+  //turn everything off
+//  digitalWrite(LBLpin, HIGH);
+//  digitalWrite(LBRpin, HIGH);
+  digitalWrite(RBLpin, HIGH);
+  digitalWrite(RBRpin, HIGH);
+  //forward
+//  digitalWrite(LBRpin, LOW);
+  digitalWrite(RBLpin, LOW);
+//  analogWrite(LTLpin, spinspd);
+  analogWrite(RTRpin, spinspd);
+  delay(delayspd);
+//  analogWrite(LTLpin, 0);
+  analogWrite(RTRpin, 0);
+//  digitalWrite(LBRpin, HIGH);
+  digitalWrite(RBLpin, HIGH);
+  delay(delayspd);
+  //backward
+//  digitalWrite(LBLpin, LOW);
+  digitalWrite(RBRpin, LOW);
+//  analogWrite(LTRpin, spinspd);
+  analogWrite(RTLpin, spinspd);
+  delay(delayspd);
+//  analogWrite(LTRpin, 0);
+  analogWrite(RTLpin, 0);
+//  digitalWrite(LBLpin, HIGH);
+  digitalWrite(RBRpin, HIGH);
+  delay(delayspd);
+}


just a quick rc control test

just a quick rc control test

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

--- RCControlTest/RCControlTest.ino
+++ RCControlTest/RCControlTest.ino
@@ -0,0 +1,16 @@
+int sensorPin = A0;    // select the input pin for the potentiometer
+unsigned long duration;
+void setup() {
+  // put your setup code here, to run once:
+  pinMode(sensorPin, INPUT);
+  Serial.begin(9600);
+
+
+}
+
+void loop() {
+  // put your main code here, to run repeatedly:
+  duration = pulseIn(sensorPin, HIGH);
+  Serial.println(duration);
+  delay(100);
+}


piezo hit counter to scoreboard

piezo hit counter to scoreboard

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

--- range/arduino/piezo_score_test/piezo_score_test.ino
+++ range/arduino/piezo_score_test/piezo_score_test.ino
@@ -0,0 +1,43 @@
+/* Records inputs from a piezo knock sensor and displays cumulative hit count */
+
+#define BAUD 9600
+#define RESEND_TIMER 100
+#define DEBOUNCE_LIMIT 100
+#define IN INT0
+
+unsigned long last_send = 0UL;
+volatile unsigned long last_strike = 0UL;
+volatile boolean report_score = false;
+volatile int counter = 0;
+
+void setup() {
+  // put your setup code here, to run once:
+  pinMode(IN, INPUT);
+  pinMode(LED_BUILTIN, OUTPUT);
+
+  Serial1.begin(BAUD);
+  delay(100);
+
+  // reset the scoreboard to zero on startup
+  Serial1.println(F("Z"));
+
+  attachInterrupt(IN, piezo, RISING);
+}
+
+void loop() {
+  // put your main code here, to run repeatedly:
+  if (report_score == true || millis() - last_send >= RESEND_TIMER) {
+    Serial1.print(F("D"));
+    Serial1.println(counter);
+    report_score = false;
+    last_send = millis();
+  }
+}
+
+void piezo() {
+  if (millis() - last_strike >= DEBOUNCE_LIMIT) {
+    report_score = true;
+    counter++;
+    last_strike = millis();
+  }
+}


arduino main

arduino main

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

--- arduino/main/main.ino
+++ arduino/main/main.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:
+
+}


Create AD9850SPI.ino

Create AD9850SPI.ino

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

--- examples/AD9850SPI.ino
+++ examples/AD9850SPI.ino
@@ -0,0 +1,29 @@
+#include <AD9850SPI.h>
+#include <SPI.h>
+
+const int W_CLK_PIN = 13;
+const int FQ_UD_PIN = 8;
+const int RESET_PIN = 9;
+
+double freq = 10000000;
+double trimFreq = 124999500;
+
+int phase = 0;
+
+void setup(){
+  DDS.begin(W_CLK_PIN, FQ_UD_PIN, RESET_PIN);
+  DDS.calibrate(trimFreq);
+}
+
+void loop(){
+  DDS.setfreq(freq, phase);
+  delay(10000);
+  DDS.down();
+  delay(3000);
+  DDS.up();
+  delay(2000);
+  DDS.setfreq(freq + 500, phase);
+  delay(5000);
+  DDS.down();
+  while(1);
+}


摄像头云平台（舵机）

摄像头云平台（舵机）

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

--- servo_camera/servo_camera.ino
+++ servo_camera/servo_camera.ino
@@ -0,0 +1,86 @@
+/*
+gongwenbo in tarsbot 11.4 at yangling
+
+Pin description:
+horizontal angle port is 9
+vertical angle port is 10
+*/
+
+#if (ARDUINO >= 100)
+ #include <Arduino.h>
+#else
+ #include <WProgram.h>
+#endif
+
+#include <Servo.h>
+#include <ros.h>
+#include <dependant_api/robotcmd_motor.h>    //publish ros message
+#include <dependant_api/arduino_motor.h>      //subscribe ros message
+
+dependant_api::arduino_motor call_a_msg;      //define subscribe ros message
+int temp_vertical= 0;         //vertical temporary parameters
+int temp_horizontal= 0;   // horizontal temporary parameter
+int flag_save_ver_angle=20;   // initial vertical angle
+int flag_h=90;                         // initial horizontal angle
+ros::NodeHandle  nh;
+ros::Publisher chatter("/arduino/motor", &call_a_msg);
+
+Servo servo_vertical;       //define vertical servo
+Servo servo_horizontal;  //define horizontal servo
+
+void servo_cb(const dependant_api::robotcmd_motor& cmd_msg)
+{
+
+   call_a_msg.id=cmd_msg.id;
+   flag_h=cmd_msg.hor_angle;
+   flag_save_ver_angle=cmd_msg.ver_angle;
+   if (flag_save_ver_angle>130) flag_save_ver_angle=130;  // the rang of vertical angle is 0~130
+
+  digitalWrite(13, HIGH-digitalRead(13));  //toggle led
+}
+
+
+ros::Subscriber<dependant_api::robotcmd_motor> sub("/robotcmd/motor", servo_cb);
+
+void setup(){
+  pinMode(13, OUTPUT);
+
+  nh.initNode();
+  nh.subscribe(sub);
+  nh.advertise(chatter);
+
+  servo_vertical.attach(10);     //attach vertical servo to pin 9
+  servo_horizontal.attach(9);   //attach horiziontal servo to pin 10
+}
+
+void loop(){
+   nh.spinOnce();
+
+
+   if (flag_save_ver_angle>temp_vertical)  temp_vertical++;       //----------------deceletate vertical servo speed--------------------//
+   else if(flag_save_ver_angle<temp_vertical) temp_vertical--;
+   else temp_vertical=flag_save_ver_angle;                                 //----------------deceletate vertical servo speed--------------------//
+
+   if (flag_h>temp_horizontal)  temp_horizontal++;                    //----------------deceletate horizontal servo speed--------------------//
+   else if(flag_h<temp_horizontal) temp_horizontal--;
+   else temp_horizontal=flag_h;                                                   //----------------deceletate horizontal servo speed--------------------//
+
+   servo_vertical.write(180-temp_vertical);                                  //adjust servo orientation
+   delay (10);                                                                                //the frequence of scanning
+   servo_horizontal.write(temp_horizontal);
+   delay (10);
+
+   call_a_msg.ret_hor= flag_h;                                                        //-------------------------feed back servo angle-------------------//
+   call_a_msg.ret_ver=180-flag_save_ver_angle;
+
+   if (call_a_msg.ret_hor==temp_horizontal) call_a_msg.ret_hor=0;
+   else call_a_msg.ret_hor=1;
+   if(call_a_msg.ret_ver=(180-temp_vertical)) call_a_msg.ret_ver=0;
+   else call_a_msg.ret_ver=1;
+
+   chatter.publish( &call_a_msg );                                               //-------------------------feed back servo angle-------------------//
+
+
+
+
+}


Create 4ledblink.ino

Create 4ledblink.ino

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

--- sFDW/examples/4ledblink.ino
+++ sFDW/examples/4ledblink.ino
@@ -0,0 +1,47 @@
+/*
+  Blink sketch for sFDW library
+  Turns on an 4 LEDs on for one second in sequence,
+  then off all at once, then on all at once, after on all at once,
+  and turn off all 4 LEDs separately.
+  And all this actions repeatedly.
+  Functions of this library:
+	- sPin(pin №, pin HIGH/LOW status <1/0> )
+	- mPinsStateHigh(pins numbers for HIGH state switch, as array - separate by ",")
+	- mPinsStateLow(pins numbers for LOW state switch, as array - separate by ",")
+  Created by Dmitry Pogudo-Georgov, December 3, 2014.
+  This example code is in the public domain.
+ */
+
+// Pins 6,7,8,9 has an LEDs connected on most Arduino boards.
+#include <sFDW.h>
+
+// the setup routine runs once when you press reset:
+void setup() {}
+
+// the loop routine runs over and over again forever:
+void loop() {
+  sFDW.sPin(6,1);   // turn the LED on (HIGH is the voltage level)
+  delay(1000);               // wait for a second
+  sFDW.sPin(7,1);
+  delay(1000);
+  sFDW.sPin(8,1);
+  delay(1000);
+  sFDW.sPin(9,1);
+  delay(1000);
+
+  sFDW.mPinsStateLow(6,7,8,9);  // turn the LED off by making the voltage LOW in all ours pins
+  delay(1000);                  // wait for a second
+
+  sFDW.mPinsStateHigh(6,7,8,9); // turn the LED on by making the voltage HIGH in all ours pins
+  delay(1000);                  // wait for a second
+
+  sFDW.sPin(6,0);   // turn the LED off (LOW is the voltage level)
+  delay(1000);               // wait for a second
+  sFDW.sPin(7,0);
+  delay(1000);
+  sFDW.sPin(8,0);
+  delay(1000);
+  sFDW.sPin(9,0);
+  delay(1000);
+
+}


Create zakir.ino

Create zakir.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/Electroscholars/LineFollower.git/'


Add ADC low-pass example

Add ADC low-pass example

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

--- examples/adc-smooth/adc-smooth.ino
+++ examples/adc-smooth/adc-smooth.ino
@@ -0,0 +1,47 @@
+// This demo compares a direct ADC reading to a smoothed value using an
+// exponentialy-weighted moving average with integer math
+
+#define POT_PIN A0 // Pin to read voltage from potentiometer
+
+// Digitized reading from potentiometer and running average
+unsigned int adcRaw = 0;
+unsigned int adc16 = 0;
+
+// Time of update step and length of update interval in ms
+unsigned long timeMarker = 0;
+const unsigned long dt = 20;
+
+// Exponentially weighted moving average for integer data. Used for over-
+// sampling noisy measurements in a time series.
+// When using the result, it must be divided by 16: x16 >> 4.
+void ewma(unsigned int x, unsigned int &x16)
+{
+  // Compute weights like 1/16*(current x) + 15/16*(prev running avg x), except
+  // multiplied through by 16 to avoid precision loss from int division:
+  // 16*xavg = x + 16*xavg - (16*xavg - 16/2)/16
+  x16 = x + x16 - ((x16 - 8) >> 4);
+}
+
+void setup()
+{
+  Serial.begin(115200);
+
+  // Wait for serial port to connect
+  while (!Serial) {;}
+}
+
+void loop()
+{
+  if (millis() - timeMarker >= dt)
+  {
+    timeMarker = millis();
+    Serial.print(timeMarker);
+    Serial.print(" ");
+    Serial.print(adcRaw);         // Snapshot of latest measurement
+    Serial.print(" ");
+    Serial.println(adc16 >> 4);   // Smoothed value
+  }
+
+  adcRaw = analogRead(POT_PIN);
+  ewma(adcRaw, adc16);
+}


moving heart rate code to src folder

moving heart rate code to src folder

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/jeremywrnr/wampum.git/'


init commit

init commit

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

--- light-bike.ino
+++ light-bike.ino
@@ -0,0 +1,100 @@
+/*
+ lite bike arduino source codes
+ Language: Wiring/Arduino
+
+ */
+
+#define LOCK 1
+#define UNLOCK 0
+#define MOVE_MAX 75
+
+int firstSensor = 0;    // first analog sensor
+int secondSensor = 0;   // second analog sensor
+int thirdSensor = 0;    // digital sensor
+int inByte = 0;         // incoming serial byte
+int led = 13;
+int ledStatus=0;
+
+int lockStatus = LOCK;
+int stolenStatus = 0;
+
+int pinS = 12;
+int pinX = A4;
+int pinY = A3;
+int pinZ = A2;
+int pinBuzzer = 8;
+
+void Buzzer_Di(int times)
+{
+  for (int i = 0; i < times; ++i) {
+    digitalWrite(pinBuzzer,HIGH); //蜂鸣器响
+    delay(200);     //延时
+    digitalWrite(pinBuzzer,LOW); //蜂鸣器关闭
+    delay(200);     //延时
+  }
+}
+
+void setup()
+{
+  // start serial port at 115200 bps:
+  Serial.begin(115200);
+  pinMode(led, OUTPUT);
+  pinMode(pinS, OUTPUT);
+  pinMode(pinX, INPUT);
+  pinMode(pinY, INPUT);
+  pinMode(pinZ, INPUT);
+  pinMode(pinBuzzer, OUTPUT);
+
+}
+int cx=0,cy=0,cz=0;
+int lastX=0, lastY=0, lastZ=0;
+int deltaX, deltaY, deltaZ;
+void loop()
+{
+  // if we get a valid byte, read analog ins:
+  if (Serial.available() > 0) {
+    // get incoming byte:
+    inByte = Serial.read();
+    if (inByte == 'L' || inByte == 'l') {
+      lockStatus = LOCK;
+    }
+    else if (inByte == 'U' || inByte == 'u'){
+      lockStatus = UNLOCK;
+      stolenStatus = 0;
+    }
+
+    Serial.println(inByte);
+  }    //ledStatus = ~ledStatus;
+
+  if (lockStatus == LOCK) {
+    cx = analogRead(pinX);
+    cy = analogRead(pinY);
+    cz = analogRead(pinZ);
+
+    deltaX = abs(cx - lastX);
+    deltaY = abs(cy - lastY);
+    deltaZ = abs(cz - lastZ);
+    if (deltaX + deltaY + deltaZ > MOVE_MAX && lastX > 0) {
+      //lockStatus = UNLOCK;
+      stolenStatus = 1;
+    }
+    /*Serial.println('start');
+     Serial.println(lockStatus);
+     Serial.println(deltaX);
+     Serial.println(deltaY);
+     Serial.println(deltaZ);
+     */
+    lastX = cx;
+    lastY = cy;
+    lastZ = cz;
+    //delay(1000);
+  }
+
+  digitalWrite(led, lockStatus);   // turn the LED on (HIGH is the voltage level)
+  if (stolenStatus == 1) {
+    Buzzer_Di(2);
+  }
+  digitalWrite(pinS, stolenStatus);   // turn the LED on (HIGH is the voltage level)
+
+  delay(200);               // wait for a second
+}


Refactor and add extra comments with explanations

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/strangetom/SmartLamp.git/'


add flower watering example

add flower watering example

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

--- examples/WATER_FLOWERS/WaterFlowers/WaterFlowers.ino
+++ examples/WATER_FLOWERS/WaterFlowers/WaterFlowers.ino
@@ -0,0 +1,61 @@
+//Libraries
+
+#include "MqttConnection.h"
+MqttConnection * myMqtt;
+
+//Constants
+#define SENSOR_ID "FLOWER1_WATER"
+#define SLEEP_TIME_S 300
+#define SENSOR_PIN A0     // what pin we're connected to
+
+//Variables
+
+
+float moisture_level;  //Stores moisture value
+
+
+/************************* WiFi Access Point *********************************/
+
+#define WLAN_SSID       "SFR_34A8"
+#define WLAN_PASS       "ab4ingrograstanstorc"
+
+/************************* MQTT *********************************/
+
+#define MQTT_SERVER  "192.168.1.27"
+#define MQTT_PORT 1883
+
+/************ Global State (you don't need to change this!) ******************/
+
+long lastMsg = 0;
+
+/*************************** Sketch Code ************************************/
+
+
+void setup()
+{
+  Serial.begin(115200);
+  myMqtt = new MqttConnection(SENSOR_ID, WLAN_SSID, WLAN_PASS, MQTT_SERVER, MQTT_PORT);
+
+  pinMode(SENSOR_PIN, INPUT);
+
+}
+
+
+void loop()
+{
+  if (!myMqtt->connected()) {
+    myMqtt->reconnect();
+  }
+  myMqtt->loop();
+
+
+
+  int analogSensor = analogRead(SENSOR_PIN);
+  Serial.print("Moisture : ");
+  Serial.println(analogSensor);
+  myMqtt->publishValue("moisture", analogSensor, 1);
+
+  delay(SLEEP_TIME_S *1000);
+}
+
+


Add experimental code (begin rewrite and improve whole project

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

--- BMP180.ino
+++ BMP180.ino
@@ -0,0 +1,350 @@
+#include <Wire.h>
+// BMP180 read/write i2c bus addres
+#define BMP180_READ_ADDR 0xF7
+#define BMP180_WRITE_ADDR 0x77
+// BMP180 calibration registers addresses
+#define BMP180_REG_ADDR_AC1 0xAA
+#define BMP180_REG_ADDR_AC2 0xAC
+#define BMP180_REG_ADDR_AC3 0xAE
+#define BMP180_REG_ADDR_AC4 0xB0
+#define BMP180_REG_ADDR_AC5 0xB2
+#define BMP180_REG_ADDR_AC6 0xB4
+#define BMP180_REG_ADDR_B1 0xB6
+#define BMP180_REG_ADDR_B2 0xB8
+#define BMP180_REG_ADDR_MB 0xBA
+#define BMP180_REG_ADDR_MC 0xBC
+#define BMP180_REG_ADDR_MD 0xBE
+// BMP180 ADC and control registers addresses
+#define BMP180_REG_ADDR_XLSB 0xF8
+#define BMP180_REG_ADDR_LSB 0xF7
+#define BMP180_REG_ADDR_MSB 0xF6
+#define BMP180_REG_ADDR_CTRL_MEAS 0xF4
+#define BMP180_REG_ADDR_RES 0xE0
+#define BMP180_REG_ADDR_ID 0xD0
+// BMP180 control commands
+#define BMP180_CMD_TEMP 0x2E
+#define BMP180_CMD_PRESS 0x34
+
+// BH1750 i2c bus address
+#define BH1750_ADDR 0x23
+// BH1750 commands
+#define BH1750_PWR_DOWN 0x00
+#define BH1750_PWR_ON 0x01
+#define BH1750_RESET 0x07
+#define BH1750_CONT_HR 0x10
+#define BH1750_CONT_HR2 0x11
+#define BH1750_CINT_LR 0x13
+#define BH1750_1TIME_HR 0x20
+#define BH1750_1TIME_HR2 0x21
+#define BH1750_1TIME_LR 0x23
+// BH1750 resolution mods
+enum BH1750_MOD{LR = 0, HR, HR2};
+
+#define DEBUG 1
+
+struct BMP180_COEFF
+{
+	int16_t ac1;
+	int16_t ac2;
+	int16_t ac3;
+	uint16_t ac4;
+	uint16_t ac5;
+	uint16_t ac6;
+	int16_t b1;
+	int16_t b2;
+	int16_t mb;
+	int16_t mc;
+	int16_t md;
+} bmp180_coeff;
+
+struct BMP180_REGS
+{
+	uint8_t xlsb;
+	uint8_t lsb;
+	uint8_t msb;
+	uint8_t ctrl;
+	uint8_t id;
+} bmp180_regs;
+
+void setup()
+{
+	Serial.begin(115200);
+	Wire.begin();
+	bmp180_init();
+	bmp180_read_calibration();
+	Serial.println(F("BMP180 inited"));
+}
+
+void loop()
+{
+	uint8_t oss = 0;
+	long int pressure;
+	long int temp;
+	uint16_t lux;
+	float lux_h;
+
+	pressure = bmp180_get_pressure(oss);
+	Serial.print(F("Pressure: "));
+	Serial.print(pressure);
+	Serial.println(F(" Pa"));
+	delay(1000);
+
+	temp = bmp180_get_temp();
+	Serial.print(F("Temp: "));
+	Serial.println(temp);
+	delay(1000);
+
+	lux = bh1750_meas_Lmode();
+	Serial.print(F("Ambient light LR: "));
+	Serial.println(lux);
+	delay(5000);
+
+	lux = bh1750_meas_Hmode();
+	Serial.print(F("Ambient light HR: "));
+	Serial.println(lux);
+	delay(5000);
+
+	lux_h = bh1750_meas_H2mode();
+	Serial.print(F("Ambient light HR2: "));
+	Serial.println(lux_h);
+	delay(5000);
+}
+// read 2 bytes from sensor
+uint16_t bmp180_read16(uint8_t reg)
+{
+	uint16_t tmp;
+	// write address of register
+	Wire.beginTransmission(BMP180_WRITE_ADDR);
+	Wire.write(reg);
+	Wire.endTransmission();
+	// request 2 bytes
+	Wire.requestFrom(BMP180_READ_ADDR, 2);
+	tmp = Wire.read();
+	tmp = (tmp << 8) | Wire.read();
+	Wire.endTransmission();
+
+	return tmp;
+}
+// read 1 byte from sensor
+uint8_t bmp180_read8(uint8_t reg)
+{
+	uint8_t tmp;
+	// write addres of register
+	Wire.beginTransmission(BMP180_WRITE_ADDR);
+	Wire.write(reg);
+	Wire.endTransmission();
+	// request 1 byte
+	Wire.requestFrom(BMP180_READ_ADDR, 1);
+	tmp = Wire.read();
+	Wire.endTransmission();
+
+	return tmp;
+}
+// read calibration table from sensor
+void bmp180_read_calibration()
+{
+	bmp180_coeff.ac1 = bmp180_read16(BMP180_REG_ADDR_AC1);
+	bmp180_coeff.ac2 = bmp180_read16(BMP180_REG_ADDR_AC2);
+	bmp180_coeff.ac3 = bmp180_read16(BMP180_REG_ADDR_AC3);
+	bmp180_coeff.ac4 = bmp180_read16(BMP180_REG_ADDR_AC4);
+	bmp180_coeff.ac5 = bmp180_read16(BMP180_REG_ADDR_AC5);
+	bmp180_coeff.ac6 = bmp180_read16(BMP180_REG_ADDR_AC6);
+	bmp180_coeff.b1 = bmp180_read16(BMP180_REG_ADDR_B1);
+	bmp180_coeff.b2 = bmp180_read16(BMP180_REG_ADDR_B2);
+	bmp180_coeff.mb = bmp180_read16(BMP180_REG_ADDR_MB);
+	bmp180_coeff.mc = bmp180_read16(BMP180_REG_ADDR_MC);
+	bmp180_coeff.md = bmp180_read16(BMP180_REG_ADDR_MD);
+}
+// check that device on this address really bmp180 sensor
+void bmp180_init()
+{
+	bmp180_regs.id = bmp180_read8(BMP180_REG_ADDR_ID);
+	if (bmp180_regs.id != 0x55)
+	{
+		Serial.println(F("Not BMP180 device ID !!!"));
+		Serial.println(bmp180_regs.id);
+		return;
+	}
+	bmp180_regs.ctrl = bmp180_read8(BMP180_REG_ADDR_CTRL_MEAS);
+}
+// read raw temperature value from regs
+int32_t bmp180_read_raw_temp()
+{
+	int32_t ut;
+	// write temperature measurement command
+	Wire.beginTransmission(BMP180_WRITE_ADDR);
+	Wire.write(BMP180_REG_ADDR_CTRL_MEAS);
+	Wire.write(BMP180_CMD_TEMP);
+	Wire.endTransmission();
+	// wait
+	delay(5);
+	// read data
+	ut = bmp180_read16(BMP180_REG_ADDR_MSB);
+
+	return ut;
+}
+// read raw pressure value from regs
+int32_t bmp180_read_raw_press(uint8_t oss)
+{
+	uint16_t tmp;
+	int32_t up;
+	// write pressure measurement command
+	Wire.beginTransmission(BMP180_WRITE_ADDR);
+	Wire.write(BMP180_REG_ADDR_CTRL_MEAS);
+	Wire.write(BMP180_CMD_PRESS | (oss << 6));
+	Wire.endTransmission();
+	// wait depend on OSS setting
+	switch (oss) {
+		case 0:
+			delay(5);
+			break;
+		case 1:
+	    	delay(8);
+	    	break;
+	    case 2:
+	    	delay(14);
+	    	break;
+	    case 3:
+	    	delay(26);
+	    default:
+	    	delay(5);
+	    	break;
+	}
+	// read data from REGs
+	tmp = bmp180_read16(BMP180_REG_ADDR_MSB);
+	up = (uint32_t) tmp << 8;
+	up |= bmp180_read8(BMP180_REG_ADDR_XLSB);
+	up = up >> (8 - oss);
+
+	return up;
+}
+// calc B5 coeff
+int32_t bmp180_calc_b5(int32_t ut)
+{
+	int32_t x1, x2, b5;
+
+	x1 = ((ut - bmp180_coeff.ac6) * bmp180_coeff.ac5) >> 15;
+	x2 = ((int32_t) bmp180_coeff.mc << 11) / (x1 + bmp180_coeff.md);
+	b5 = x1 + x2;
+
+	return b5;
+}
+// get real value of temperature
+int32_t bmp180_get_temp()
+{
+	int32_t ut, t;
+	// read raw values of regs
+	ut = bmp180_read_raw_temp();
+	// calc real temperature
+	t = (bmp180_calc_b5(ut) + 8) >> 4;
+
+	return t;
+}
+// get real value of pressure
+int32_t bmp180_get_pressure(uint8_t oss)
+{
+	int32_t ut, up, x1, x2, x3, b5, b3, b6, p;
+	uint32_t b4, b7;
+	// read raw registers values
+	ut = bmp180_read_raw_temp();
+	up = bmp180_read_raw_press(oss);
+	// doing some *__* MAGICK *v_v*
+	b5 = bmp180_calc_b5(ut);
+	b6 = b5 - 4000;
+	x1 = (bmp180_coeff.b2 * ((b6 * b6) >> 12)) >> 11;
+	x2 = (bmp180_coeff.ac2 * b6) >> 11;
+	x3 = x1 + x2;
+	b3 = ((((bmp180_coeff.ac1 * 4) + x3) << oss) + 2) >> 2;
+	x1 = (bmp180_coeff.ac3 * b6) >> 13;
+	x2 = (bmp180_coeff.b1 * ((b6 * b6) >> 12)) >> 16;
+	x3 = ((x1 + x2) + 2) >> 2;
+	b4 = (bmp180_coeff.ac4 * (uint32_t) (x3 + 32768)) >> 15;
+	b7 = ((uint32_t) up - b3) * (50000 >> oss);
+	if (b7 < 0x80000000) {
+		p = (b7 << 1) / b4;
+	} else {
+		p = (b7 / b4) >> 1;
+	}
+	x1 = (p >> 8) * (p >> 8);
+	x1 = (x1 * 3038) >> 16;
+	x2 = (-7357 * p) >> 16;
+	p = p + ((x1 + x2 + 3791) >> 4);
+
+	return p;
+}
+
+void bh1750_write_cmd(uint8_t cmd)
+{
+	Wire.beginTransmission(BH1750_ADDR);
+	Wire.write(cmd);
+	Wire.endTransmission();
+}
+
+uint16_t bh1750_read_data()
+{
+	uint16_t tmp;
+
+	Wire.requestFrom(BH1750_ADDR, 2);
+	tmp = Wire.read();
+	tmp = (tmp << 8) | Wire.read();
+	Wire.endTransmission();
+
+	return tmp;
+}
+
+uint16_t bh1750_meas_Lmode()
+{
+	uint16_t val, tmp;
+
+	bh1750_write_cmd(BH1750_PWR_ON);
+	bh1750_write_cmd(BH1750_1TIME_LR);
+	delay(24);
+	tmp = bh1750_read_data();
+	#if DEBUG
+	Serial.print(F("Raw value: "));
+	Serial.println(tmp);
+	#endif
+	val = (float) tmp / 1.2;
+	return val;
+}
+
+uint16_t bh1750_meas_Hmode()
+{
+	uint16_t val, tmp;
+
+	bh1750_write_cmd(BH1750_PWR_ON);
+	bh1750_write_cmd(BH1750_1TIME_HR);
+	delay(180);
+	tmp = bh1750_read_data();
+	#if DEBUG
+	Serial.print(F("Raw value: "));
+	Serial.println(tmp);
+	#endif
+	val = (float) tmp / 1.2;
+	return val;
+}
+
+float bh1750_meas_H2mode()
+{
+	float val;
+	uint16_t tmp, fl;
+
+	bh1750_write_cmd(BH1750_PWR_ON);
+	bh1750_write_cmd(BH1750_1TIME_HR2);
+	delay(180);
+	tmp = bh1750_read_data();
+	#if DEBUG
+	Serial.print(F("Raw value: "));
+	Serial.println(tmp);
+	#endif
+	fl = tmp & 0x0001;
+	#if DEBUG
+	Serial.println(fl);
+	#endif
+	tmp >>= 1;
+	#if DEBUG
+	Serial.println(tmp);
+	#endif
+	val = (float) tmp / 1.2 + fl * 0.5;
+	return val;
+}


Basic motor driving.

Basic motor driving.

--- motorcontrol/motorcontrol.ino
+++ motorcontrol/motorcontrol.ino
@@ -0,0 +1,80 @@
+const int motor1 = 3;
+const int motor1_dir_A = 2;
+const int motor1_dir_B = 4;
+const int motor2 = 6;
+const int motor2_dir_A = 7;
+const int motor2_dir_B = 8;
+
+int motor1_speed = 0;
+int motor2_speed = 0;
+
+void setup()
+{
+  pinMode(motor1, OUTPUT);
+  pinMode(motor1_dir_A, OUTPUT);
+  pinMode(motor1_dir_B, OUTPUT);
+  pinMode(motor2, OUTPUT);
+  pinMode(motor2_dir_A, OUTPUT);
+  pinMode(motor2_dir_B, OUTPUT);
+
+  setMotorDirection(motor1, 0);
+  setMotorDirection(motor2, 0);
+  Serial.begin(9600);
+  while (! Serial);
+
+}
+
+
+void loop()
+{
+  if (Serial.available())
+  {
+    char key = Serial.read();
+    if (key == 'f')
+    {
+      Serial.println("forward");
+      setMotorDirection(motor1, 0);
+    }
+    if (key == 'b')
+    {
+      Serial.println("backward");
+      setMotorDirection(motor1, 1);
+    }
+    if (key == 'u')
+    {
+      Serial.println("speedup");
+      motor1_speed += 50;
+      setMotorSpeed(motor1, motor1_speed);
+    }
+    if (key == 'd')
+    {
+      Serial.println("speeddown");
+      motor1_speed -+ 50;
+      setMotorSpeed(motor1, motor1_speed);
+    }
+  }
+}
+
+/*
+*  Change motor direction
+*  0-forward 1-backward
+*/
+void setMotorDirection(int motor, int dir){
+   Serial.println("setmotordirection");
+   if(motor == motor1){
+     digitalWrite(motor1_dir_A, !dir);
+     digitalWrite(motor1_dir_B, dir);
+   }
+   else {
+     digitalWrite(motor2_dir_A, !dir);
+     digitalWrite(motor2_dir_B, dir);
+   }
+}
+
+void setMotorSpeed(int motor, int speed){
+    Serial.println("setmotorspeed");
+    if (speed >= 0 && speed <= 255)
+    {
+      analogWrite(motor, speed);
+    }
+}


let's see if we need something like this …

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/trinamic/T-Bone.git/'