Create three_moving_colors.ino

Create three_moving_colors.ino

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

--- three_moving_colors.ino
+++ three_moving_colors.ino
@@ -0,0 +1,49 @@
+//***************************************************************
+// Three moving colors.
+//
+// Marc Miller,  Jan. 2019
+//***************************************************************
+
+#include "FastLED.h"
+#define LED_TYPE LPD8806
+#define DATA_PIN 11
+#define CLOCK_PIN 13
+#define NUM_LEDS 32
+#define COLOR_ORDER GRB
+#define MASTER_BRIGHTNESS 64
+CRGB leds[NUM_LEDS];
+
+int16_t positionRed = NUM_LEDS*2/3;  // Set initial start position of Red
+int16_t positionWhite = NUM_LEDS/3;  // Set initial start position of White
+int16_t positionBlue = 0;  // Set initial start position of Blue
+
+uint16_t holdTime = 120;  // Milliseconds to hold position before advancing
+int8_t delta = 1;  // 1 or -1.  Sets forward or backwards direction.
+
+
+//---------------------------------------------------------------
+void setup() {
+  delay(1500);  // Startup delay
+  FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);
+  //FastLED.addLeds<LED_TYPE,DATA_PIN>(leds, NUM_LEDS);
+  FastLED.setBrightness(MASTER_BRIGHTNESS);
+}
+
+
+//---------------------------------------------------------------
+void loop() {
+  //set position and color of pixels
+  leds[(positionRed + delta + NUM_LEDS) % NUM_LEDS] = CRGB::Red;
+  leds[(positionWhite + delta + NUM_LEDS) % NUM_LEDS] = CRGB::Grey;
+  leds[(positionBlue + delta + NUM_LEDS) % NUM_LEDS] = CRGB::Blue;
+
+  FastLED.show();  //show the pixels
+  FastLED.delay(holdTime);  //delay for a bit.
+
+  //advance position based on delta, and rollover if needed.
+  positionRed = ((positionRed + delta + NUM_LEDS) % NUM_LEDS);
+  positionWhite = ((positionWhite + delta + NUM_LEDS) % NUM_LEDS);
+  positionBlue = ((positionBlue + delta + NUM_LEDS) % NUM_LEDS);
+
+}//end_main_loop
+


insert real commit message here

insert real commit message here

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

--- pi_interrupt_mouse/pi_interrupt_mouse.ino
+++ pi_interrupt_mouse/pi_interrupt_mouse.ino
@@ -0,0 +1,76 @@
+#include "HID-Project.h"
+//  See HID Project documentation for more infos
+//  https://github.com/NicoHood/HID/wiki/Mouse-API
+//  https://github.com/NicoHood/HID/wiki/AbsoluteMouse-API
+
+
+enum states { // fuck you wade
+  NO_CLICK, // No tap has been detected yet
+  CLICK, // A single tap has been detected
+  HOLD, // A double tap has been detected
+  DRAG, // No tap has been detected since Hold was sent
+  RELEASE, // A tap has been detected during the Drag state
+};
+
+enum states state = NO_CLICK; // Set the init state too no click
+
+void setup() {
+  Serial.begin(9600);    // serial / USB port
+  Serial1.begin(9600);   // Arduino RX - white, Arduino TX - green
+  AbsoluteMouse.begin();
+  attachInterrupt(digitalPinToInterrupt(2), interrupt, RISING); //interrupt pin from Mega (hock up pin 35 mega to 2 leo)
+
+  delay(2000);
+}
+
+void loop() {
+  if (state == CLICK){
+    delay(500); //delay so if there's another interrupt it will change state
+  }
+
+  switch(state) {
+    case CLICK:
+      AbsoluteMouse.click();
+      state = NO_CLICK;
+      break;
+    case HOLD:
+      AbsoluteMouse.press();
+      state = DRAG;
+      break;
+    case RELEASE:
+      AbsoluteMouse.release();
+      state = NO_CLICK;
+      break;
+  }
+
+  String cmd = "";
+  //command terminates with '.'
+
+  // check if byte available on the software serial port
+  //receives zero-padded string of 16 bit coordinates (xy) ending with a '.'
+  if(Serial1.available()){
+    cmd = (Serial1.readStringUntil('.'));
+    //Serial.println(cmd);
+    String dx = cmd.substring(0,4);
+    String dy = cmd.substring(5,9);
+    float x = dx.toFloat();
+    float y = dy.toFloat();
+    AbsoluteMouse.moveTo(x,y);
+  }
+
+}
+
+void interrupt() {
+  //detachInterrupt(digitalPinToInterrupt(2));
+  switch(state) {
+    case NO_CLICK:
+      state = CLICK;
+      break;
+    case CLICK:
+      state = HOLD;
+      break;
+    case DRAG:
+      state = RELEASE;
+  }
+  //attachInterrupt(digitalPinToInterrupt(2), interrupt, RISING);
+}


Commented out the installSavedProgram() function call because the EEPROM stuff is not finished yet.

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


Changed firmware to execute Uzi programs and also echo any serial data.


BendingWrist.ino

BendingWrist.ino

The code for the bending wrist using I2C to communicate with the BNO055 device and controlling the servo to maintain the level

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

--- home/juerg/BendingWrist.ino
+++ home/juerg/BendingWrist.ino
@@ -0,0 +1,176 @@
+
+#include <Servo.h>
+#include <Wire.h>
+#include <Adafruit_Sensor.h>
+#include <Adafruit_BNO055.h>
+#include <utility/imumaths.h>
+
+/* This driver uses the Adafruit unified sensor library (Adafruit_Sensor),
+which provides a common 'type' for sensor data and some helper functions.
+
+To use this driver you will also need to download the Adafruit_Sensor
+library and include it in your libraries folder.
+
+You should also assign a unique ID to this sensor for use with
+the Adafruit Sensor API so that you can identify this particular
+sensor in any data logs, etc.  To assign a unique ID, simply
+provide an appropriate value in the constructor below (12345
+is used by default in this example).
+
+Connections
+===========
+Connect SCL to analog 5
+Connect SDA to analog 4
+Connect VDD to 3-5V DC
+Connect GROUND to common ground
+
+History
+=======
+2015/MAR/03  - First release (KTOWN)
+2015/AUG/27  - Added calibration and system status helpers
+*/
+
+#define PIN_COMMAND (8)
+int pitchServoPin = 9;
+int rollServoPin = 10;
+int FeedbackPin = 13; /* interne gelbe LED */
+
+Servo rollServo;  // create servo object to control turning movement
+Servo pitchServo;  // create servo object to control bending movement
+
+int CommandMode;
+int ModeBefore;
+
+int rollValue = 1500;    // variable to store the servo position
+int rollMin = 600;
+int rollMax = 2400;
+int rollRead;           // normalized roll value
+int rollKorr = 5;
+
+int pitchValue = 1500;    // variable to store the target servo position
+int pitchMin = 600;
+int pitchMax = 2400;
+int pitchRead;          // calibrated pitch value
+int pitchKorr = -1;
+
+/* Set the delay between fresh samples */
+#define BNO055_SAMPLERATE_DELAY_MS (20)
+
+Adafruit_BNO055 bno = Adafruit_BNO055(55);
+
+
+/**************************************************************************/
+/*
+Arduino setup function (automatically called at startup)
+*/
+/**************************************************************************/
+void setup(void)
+{
+
+	Serial.begin(9600);
+	Serial.println("Orientation Sensor Test"); Serial.println("");
+
+	/* Initialise the sensor */
+	if (!bno.begin())
+	{
+		/* There was a problem detecting the BNO055 ... check your connections */
+		Serial.print("Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!");
+		while (1);
+	}
+
+	delay(1000);
+
+	bno.setExtCrystalUse(true);
+
+  pinMode(PIN_COMMAND, INPUT_PULLUP); // the self-control is activated with pin in high state (1)
+  ModeBefore = LOW;
+}
+
+/**************************************************************************/
+/*
+Arduino loop function, called once 'setup' is complete (your own code
+should go here)
+*/
+/**************************************************************************/
+void loop(void)
+{
+
+	sensors_event_t event;
+  int rollCorrFactor;
+  int pitchCorrFactor;
+
+  /* Check for activated Command pin */
+  CommandMode = digitalRead(PIN_COMMAND);
+
+  if (CommandMode == HIGH) {
+
+    if (ModeBefore == LOW) {
+        rollServo.attach(rollServoPin);  // attaches the servo on pin 10 to the servo object
+        pitchServo.attach(pitchServoPin);  // attaches the servo on pin  9 to the servo object
+        ModeBefore = HIGH;
+        digitalWrite(FeedbackPin, HIGH);
+    }
+
+  	/* Get a new sensor event */
+  	bno.getEvent(&event);
+
+
+    /* use pitch value to change servo command
+    -----------------------------------------*/
+    pitchRead = event.orientation.y + pitchKorr;
+
+    if (abs(pitchRead) > 10) {
+      pitchValue = pitchValue + (pitchRead * 5);
+    } else {
+      pitchValue = pitchValue + (pitchRead * 3);
+    }
+
+    /* limit to min value */
+    if (pitchValue > pitchMax) pitchValue = pitchMax;
+    if (pitchValue < pitchMin) pitchValue = pitchMin;
+
+
+    pitchServo.writeMicroseconds(pitchValue);
+
+    Serial.print("\tPitch: ");
+    Serial.print(event.orientation.y);
+    Serial.print("\t pitchServo target: ");
+    Serial.print(pitchValue);
+
+
+    /* as the sensor is below the hand the goal is to get 180 degree roll
+    normalize the value
+    */
+    if (event.orientation.z < 0) rollRead = 360 + event.orientation.z + rollKorr;
+    if (event.orientation.z >= 0) rollRead = event.orientation.z + rollKorr;
+    Serial.print("\trollRead: "); Serial.print(rollRead);
+
+
+    rollValue = rollValue - ((rollRead - 180) * 5);
+
+    /* do not cross the limits */
+    if (rollValue > rollMax) rollValue = rollMax;
+    if (rollValue < rollMin) rollValue = rollMin;
+
+
+    Serial.print("\t rollServo target: ");
+    Serial.print(rollValue);
+    rollServo.writeMicroseconds(rollValue);
+
+
+    /* New line for the next sample */
+    Serial.println("");
+
+  } else {
+      if (ModeBefore == HIGH) {
+        rollServo.detach();  // detaches the servo on pin 10 to the servo object
+        pitchServo.detach();  // detaches the servo on pin  9 to the servo object
+        ModeBefore = LOW;
+        digitalWrite(FeedbackPin, LOW);
+    }
+  }
+
+  /* Wait the specified delay before requesting nex data */
+  delay(BNO055_SAMPLERATE_DELAY_MS);
+
+}


Calling it a night

Calling it a night

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


Added: SimplePlantMonitor example

Added: SimplePlantMonitor example

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

--- examples/ESP8266/SimplePlantMonitor/SimplePlantMonitor.ino
+++ examples/ESP8266/SimplePlantMonitor/SimplePlantMonitor.ino
@@ -0,0 +1,110 @@
+/*
+  SimplePlantMonitor by Meeo
+
+  This example will make use of Meeo. If you haven't already,
+  visit Meeo at https://meeo.io and create an account. Then
+  check how to get started with the Meeo library through
+  https://github.com/meeo/meeo-arduino
+
+  Show your love to your green friends with this simple
+  temperature, humidity and soil moisture sensing for your
+  plants.
+  More details of the project here: https://meeo.io/l/1000
+
+  Copyright: Meeo
+  Author: Terence Anton Dela Fuente
+  License: MIT
+*/
+#include <Meeo.h>
+#include <Adafruit_Sensor.h>
+#include <DHT.h>
+#include <DHT_U.h>
+
+#define DHTPIN D3
+#define DHTTYPE DHT11
+#define SOILMOISTUREPIN A0
+
+unsigned long previous = 0;
+
+String nameSpace = "my_namespace";
+String accessKey = "my_access_key";
+String ssid = "MyWiFi";
+String pass = "qwerty123";
+String temperatureChannel = "plant-ambient-temperature";
+String humidityChannel = "plant-ambient-humidity";
+String moistureChannel = "plant-soil-moisture";
+
+DHT_Unified dht(DHTPIN, DHTTYPE);
+
+void setup() {
+  Serial.begin(115200);
+
+  Meeo.setEventHandler(meeoEventHandler);
+  Meeo.setDataReceivedHandler(meeoDataHandler);
+  Meeo.begin(nameSpace, accessKey, ssid, pass);
+
+  //Initialize your DHT Sensor
+  dht.begin();
+}
+
+void loop() {
+  Meeo.run();
+
+  unsigned long now = millis();
+  // Check the sensors every 3 seconds
+  if (now - previous > 3000) {
+    previous = now;
+
+    sensors_event_t event;
+
+    dht.temperature().getEvent(&event);
+    int temperature = event.temperature;
+
+    dht.humidity().getEvent(&event);
+    int humidity = event.relative_humidity;
+
+    if (!isnan(temperature) && temperature <= 200) {
+      Meeo.publish(temperatureChannel, String(temperature) + "C");
+    }
+
+    if (!isnan(humidity) && humidity <= 100) {
+      Meeo.publish(humidityChannel, String(humidity));
+    }
+
+    Meeo.publish(moistureChannel, String(map(analogRead(SOILMOISTUREPIN),0,1023,0,100)));
+  }
+}
+
+void meeoDataHandler(String topic, String payload) {
+  Serial.print(topic);
+  Serial.print(": ");
+  Serial.println(payload);
+}
+
+void meeoEventHandler(MeeoEventType event) {
+  switch (event) {
+    case WIFI_DISCONNECTED:
+      Serial.println("Not Connected to WiFi");
+      break;
+    case WIFI_CONNECTING:
+      Serial.println("Connecting to WiFi");
+      break;
+    case WIFI_CONNECTED:
+      Serial.println("Connected to WiFi");
+      break;
+    case MQ_DISCONNECTED:
+      Serial.println("Not Connected to MQTT Server");
+      break;
+    case MQ_CONNECTED:
+      Serial.println("Connected to MQTT Server");
+      break;
+    case MQ_BAD_CREDENTIALS:
+      Serial.println("Bad Credentials");
+      break;
+    case AP_MODE:
+      Serial.println("AP Mode");
+      break;
+    default:
+      break;
+  }
+}


Memory expansion

Memory expansion

test run ok

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

--- Meng/Memory.ino
+++ Meng/Memory.ino
@@ -0,0 +1,75 @@
+/*
+Used the following components and wire routing:
+(1) Arduino Uno
+(2) Microchip 23LCV1024
+(3) 10K Resistor
+*/
+
+// Arduino Pinouts
+// 1-4 GND
+// 2 MISO ATMEGA PIN 18
+//   Arduino Digital PIN 12
+// 3 NC
+// 5 MOSI ATMEGA PIN 17
+//   Arduino Digital PIN 11
+// 6 SCK ATMEGA PIN 19
+//   Arduino Digital PIN 13
+// 7 V_BAT CR2032
+// 8 5V Power
+
+// Wire Routing
+// Arduino-- 23LC1024
+// D13 <------> SCK
+// D12 <------> MISO
+// D11 <------> MOSI
+// D10 <------> CS, but CS tied to GND here
+// 5V  <------> VCC
+// 5V  <------> HOLD
+// 5V  <-10KR-> CS, but CS tied to  GND here so no resistor needed
+// GND <------> VSS
+
+
+#include <SPI.h>
+
+//SRAM opcodes
+#define RDSR        5
+#define WRSR        1
+#define READ        3
+#define WRITE       2
+
+//Byte transfer functions
+uint8_t Spi23LC1024Read8(uint32_t address) {
+	uint8_t read_byte;
+
+	SPI.transfer(READ);
+	SPI.transfer((uint8_t)(address >> 16) & 0xff);
+	SPI.transfer((uint8_t)(address >> 8) & 0xff);
+	SPI.transfer((uint8_t)address);
+	read_byte = SPI.transfer(0x00);
+	return read_byte;
+}
+
+void Spi23LC1024Write8(uint32_t address, uint8_t data_byte) {
+	SPI.transfer(WRITE);
+	SPI.transfer((uint8_t)(address >> 16) & 0xff);
+	SPI.transfer((uint8_t)(address >> 8) & 0xff);
+	SPI.transfer((uint8_t)address);
+	SPI.transfer(data_byte);
+}
+
+void setup(void) {
+	uint32_t i;
+	uint8_t value;
+
+	Serial.begin(9600);
+	SPI.begin();
+
+	for (i = 0; i<32; i++) {
+		Spi23LC1024Write8(i, (uint8_t)i);
+		value =  (i);
+		Serial.println((uint16_t)value);
+	}
+}
+
+void loop() {
+}


LoRa_Radiohead_RX_esp8266

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

--- experiments/LoRa_Radiohead_RX_esp8266/LoRa_Radiohead_RX_esp8266.ino
+++ experiments/LoRa_Radiohead_RX_esp8266/LoRa_Radiohead_RX_esp8266.ino
@@ -0,0 +1,152 @@
+// Arduino9x_RX
+// -*- mode: C++ -*-
+// Example sketch showing how to create a simple messaging client (receiver)
+// with the RH_RF95 class. RH_RF95 class does not provide for addressing or
+// reliability, so you should only use RH_RF95 if you do not need the higher
+// level messaging abilities.
+// It is designed to work with the other example Arduino9x_TX
+
+#include <SPI.h>
+#include <RH_RF95.h>
+// oled display
+//#include "U8glib.h"
+
+
+#define RFM95_CS D1
+//#define RFM95_RST 2
+#define RFM95_INT D2
+
+// Change to 434.0 or other frequency, must match RX's freq!
+#define RF95_FREQ 868.0
+
+
+
+// Singleton instance of the radio driver
+RH_RF95 rf95(RFM95_CS, RFM95_INT);
+
+// OLED
+//U8GLIB_SSD1306_128X64_2X u8g(U8G_I2C_OPT_NONE);
+
+typedef struct{
+  int num;
+  int rssi;
+}
+monitor_t;
+monitor_t monitor;
+
+void setup()
+{
+  //pinMode(LED, OUTPUT);
+  //pinMode(RFM95_RST, OUTPUT);
+  //digitalWrite(RFM95_RST, HIGH);
+
+
+SPI.setFrequency(8000000);
+  Serial.begin(115200);
+
+  //u8g.setRot180();
+  monitor.num = 0;
+  monitor.rssi = 0;
+  displayUpdate();
+
+  delay(100);
+
+  Serial.println("Arduino LoRa RX Test!");
+
+  // manual reset
+//  digitalWrite(RFM95_RST, LOW);
+//  delay(10);
+//  digitalWrite(RFM95_RST, HIGH);
+//  delay(10);
+
+  while (!rf95.init()) {
+    Serial.println("LoRa radio init failed");
+    while (1);
+  }
+  Serial.println("LoRa radio init OK!");
+
+  // Defaults after init are 434.0MHz, modulation GFSK_Rb250Fd250, +13dbM
+  if (!rf95.setFrequency(RF95_FREQ)) {
+    Serial.println("setFrequency failed");
+    while (1);
+  }
+  Serial.print("Set Freq to: "); Serial.println(RF95_FREQ);
+
+  // Defaults after init are 434.0MHz, 13dBm, Bw = 125 kHz, Cr = 4/5, Sf = 128chips/symbol, CRC on
+
+  // The default transmitter power is 13dBm, using PA_BOOST.
+  // If you are using RFM95/96/97/98 modules which uses the PA_BOOST transmitter pin, then
+  // you can set transmitter powers from 5 to 23 dBm:
+  rf95.setTxPower(23, false);
+}
+
+void loop()
+{
+  if (rf95.available())
+  {
+    // Should be a message for us now
+    uint8_t buf[RH_RF95_MAX_MESSAGE_LEN];
+    uint8_t len = sizeof(buf);
+
+    if (rf95.recv(buf, &len))
+    {
+      //digitalWrite(LED, HIGH);
+      RH_RF95::printBuffer("Received: ", buf, len);
+      Serial.print("Got: ");
+      Serial.println((char*)buf);
+      int num = atoi((char*)buf);
+      Serial.println(num);
+       Serial.print("RSSI: ");
+
+      int rssi = rf95.lastRssi();
+      Serial.println(rf95.lastRssi(), DEC);
+
+      monitor.num = num;
+      monitor.rssi = rssi;
+      displayUpdate();
+
+      // Send a reply
+      //uint8_t data[] = "And hello back to you";
+      uint8_t radiopacket[30]   = "                   ";
+      itoa(num, (char*)radiopacket, 10);
+      rf95.send(radiopacket, sizeof(radiopacket));
+      rf95.waitPacketSent();
+      Serial.println("Sent a reply");
+      //digitalWrite(LED, LOW);
+
+
+
+
+
+    }
+    else
+    {
+      Serial.println("Receive failed");
+    }
+  }
+}
+
+void displayUpdate()
+{
+//  // picture loop
+//  u8g.firstPage();
+//  do {
+//    draw();
+//  } while( u8g.nextPage() );
+}
+
+void draw(void) {
+  // graphic commands to redraw the complete screen should be placed here
+//
+//  u8g.setFont(u8g_font_fub11n);
+//  //u8g.setFont(u8g_font_unifont);
+//  u8g.setFontPosTop();
+//
+//  u8g.setPrintPos(0, 0);
+//  u8g.print(monitor.num);
+//
+//  u8g.setPrintPos(0, 20);
+//  u8g.print(monitor.rssi);
+
+}
+


Adds code for takeoff and landing

Adds code for takeoff and landing

Creates two functions for the tasks described above. There are several
TODO's, simply because some of the things there are left to do here are
unknown, such as determining the height of the drone. This code should
serve as a good starting point, however.

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

--- drone_control/drone_control.ino
+++ drone_control/drone_control.ino
@@ -0,0 +1,74 @@
+/*
+ *
+ */
+
+#include <Servo.h>
+
+typedef unsigned long ulong;
+
+#define SERVO_OFF  1000
+#define SERVO_HOVER 1000 // TODO: Find the actual value
+#define SERVO_FULL 2000 // TODO: Find the actual value
+#define FRONT_LEFT 0
+#define FRONT_RIGHT 1
+#define BACK_LEFT 2
+#define BACK_RIGHT 3
+
+Servo rotor[4];
+ulong TimeSinceStart;
+ulong TimeDelta;
+bool ManualControl;
+
+
+double MicrosToSecond(ulong micro){
+  return micro / 1000000.f;
+}
+
+void LiftOff(float feet){
+  double Height = 0;
+  // Read the height from the ultrasonic sensors
+  for (int i = 0; i < 4; ++i)
+    rotor[i].writeMicroseconds(SERVO_HOVER + 250); // Put all four motors on low power, but can still go up.
+
+  while (Height < feet)
+  {
+    Height = feet + 1; // Fill this in with the actual height-finding code later
+  }
+  for (int i = 0; i < 4; ++i)
+    rotor[i].writeMicroseconds(SERVO_HOVER);
+}
+
+void Land()
+{
+  double Height = 0;
+  for (int i = 0; i < 4; ++i)
+    rotor[i].writeMicroseconds(SERVO_HOVER - 250); // Put all four motors on low power, but can still go up.
+
+  while (Height > .5)
+  {
+    Height = 0; // Fill this in with the actual height-finding code later
+  }
+  for (int i = 0; i < 4; ++i)
+    rotor[i].writeMicroseconds(SERVO_OFF);
+}
+
+void setup() {
+  TimeSinceStart = millis();
+  TimeDelta = 0;
+
+  for (int i = 0; i < 4; ++i){
+    rotor[i].attach(i); // Set up ESC channels. TODO: Find the offset for i in this case
+    rotor[i].writeMicroseconds(SERVO_OFF);
+  }
+  delay(5000);
+  LiftOff(1.5);
+
+  delay(5000);
+  Land();
+}
+
+void loop(){
+  TimeDelta = micros() - TimeSinceStart;
+  TimeSinceStart = micros();
+}
+


the target status decides if the pos_comp is obeyed

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


Updated DHCP Address printer for Ethernet library

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

--- libraries/Ethernet/examples/DhcpAddressPrinter/DhcpAddressPrinter.ino
+++ libraries/Ethernet/examples/DhcpAddressPrinter/DhcpAddressPrinter.ino
@@ -0,0 +1,54 @@
+/*
+  DHCP-based IP printer
+
+ This sketch uses the DHCP extensions to the Ethernet library
+ to get an IP address via DHCP and print the address obtained.
+ using an Arduino Wiznet Ethernet shield.
+
+ Circuit:
+ * Ethernet shield attached to pins 10, 11, 12, 13
+
+ created 12 April 2011
+ by Tom Igoe
+
+ */
+
+#include <SPI.h>
+#include <Ethernet.h>
+
+// Enter a MAC address for your controller below.
+// Newer Ethernet shields have a MAC address printed on a sticker on the shield
+byte mac[] = {
+  0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
+
+// Initialize the Ethernet client library
+// with the IP address and port of the server
+// that you want to connect to (port 80 is default for HTTP):
+Client client;
+
+void setup() {
+  // start the serial library:
+  Serial.begin(9600);
+  // start the Ethernet connection:
+  Serial.println("Trying to get an IP address using DHCP");z
+  if (Ethernet.begin(mac) == 0) {
+    Serial.println("Failed to configure Ethernet using DHCP");
+    // no point in carrying on, so do nothing forevermore:
+    while(true);
+  }
+  // print your local IP address:
+  Serial.print("My IP address: ");
+  IPAddress myIPAddress = Ethernet.localIP();
+  for (byte thisByte = 0; thisByte < 4; thisByte++) {
+    // print the value of each byte of the IP address:
+    Serial.print(myIPAddress[thisByte], DEC);
+    Serial.print(".");
+  }
+  Serial.println();
+}
+
+void loop() {
+
+}
+
+


Initial Arduino with Onboard Server for Choose_Video

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

--- server/pusher/choose_video.ino
+++ server/pusher/choose_video.ino
@@ -0,0 +1,172 @@
+#include <PusherClient.h>
+#include <Ethernet.h>
+#include <SPI.h>
+
+char subscribe[] = "choose_video";
+char receive_channel[] = "choose_video";
+String pusher_channel = "choose_video";
+String pusher_event_register = "arduino_event_register";
+String fact[] = {"a", "b","c", "JacobHanshaw"};
+int fact_delays[] = { 4000, 4000, 4000, 4000};
+int facts = 4;
+
+EthernetClient arisClient;
+PusherClient pusherClient;
+
+byte mac[] = {
+  0x90, 0xA2, 0xDA, 0x0C, 0x00, 0x83 };
+byte aris[] = {
+  50, 56, 80, 147 };
+
+const int relayPin1 = 2;
+const int relayPin2 = 3;
+const int video_over = 6;
+
+int video1Votes = 0;
+int video2Votes = 0;
+int members = 0;
+
+void setup() {
+  //Serial.begin(9600);
+  Serial.println("Setup...");
+  Ethernet.begin(mac); //,ip
+  delay(1000); //Give time to initialize before connecting
+
+  pinMode(relayPin1, OUTPUT);
+  pinMode(relayPin2, OUTPUT);
+  //pinMode(video_over, INPUT);
+
+  while(!pusherClient.connect("7fe26fe9f55d4b78ea02")){}
+  while(!pushMessage(pusher_channel, pusher_event_register, "success")) {}
+  pusherClient.bind("Member_Added", memberAdd);
+  pusherClient.bind("Member_Removed", memberRemove);
+  pusherClient.bind("Cast_Vote", eventHandler);
+  //  pusherClient.bindAll(eventHandler);
+  //  pusherClient.bind(subscribe, eventHandler);
+  pusherClient.subscribe(receive_channel);
+  Serial.println("Pusher Connect Success!");
+}
+
+
+void loop() {
+  pusherClient.monitor();
+  if(members > 0){
+    //Begin the login time
+    long startTime = millis();
+    while((millis() -startTime) <= 15000){
+      pusherClient.monitor();
+      int time = (millis()-startTime);
+      if(time % 1000 <= 10){
+        String output = (String)time;
+        while(!pushMessage(pusher_channel, "Clock_Time", output)) { }
+      }
+    }
+    //Begin Voting
+    while(!pushMessage(pusher_channel, "Begin_Voting", "")) { }
+    startTime = millis();
+    while((millis() -startTime) <= 30000 && members != (video1Votes + video2Votes)){
+      pusherClient.monitor();
+    }
+    //Voting Complete, trigger the pin
+    if(video1Votes >= video2Votes){
+      digitalWrite(relayPin1, HIGH);
+      delay(500);
+      digitalWrite(relayPin1, LOW);
+      Serial.println("Video 1 Wins!");
+    }
+    else{
+      digitalWrite(relayPin2, HIGH);
+      delay(500);
+      digitalWrite(relayPin2, LOW);
+      Serial.println("Video 2 Wins!");
+    }
+    video1Votes = 0;
+    video2Votes = 0;
+
+    //Tell clients, Voting is complete
+    while(!pushMessage(pusher_channel, "Done_Voting", "")) {
+    }
+    delay(2000);
+    for(int i = 0; i < facts; i++){
+       while(!pushMessage(pusher_channel, "Message", fact[i])) { }
+       delay(fact_delays[i]);
+    }
+    //while(digitalRead(video_over) == LOW) { }
+    while(!pushMessage(pusher_channel, "Video_Over", "")) {
+    }
+  }
+}
+
+void memberAdd(String data) {
+  members++;
+ // Serial.println("Members: ");
+ // Serial.println(members);
+}
+
+void memberRemove(String data) {
+  if(members-1>=0){
+    members--;
+  }
+//  Serial.println("Members: ");
+//  Serial.println(members);
+}
+
+void eventHandler(String data) {
+  //Serial.println(data);
+  int firstColon = data.indexOf(':');
+  int secondColon = data.indexOf(':', firstColon + 1 );
+  int start = secondColon + 4;
+  int endQuote = data.indexOf('"', start);
+  int endofData = endQuote -1;
+  String importantData = data.substring(start, endofData);
+ // Serial.println(importantData);
+  if(importantData.charAt(0) == 'v'){
+    importantData = importantData.substring(1);
+    char pointer[importantData.length()];
+    for(int i = 0; i < importantData.length(); i++){
+      pointer[i] = importantData.charAt(i);
+    }
+    int vote = atoi(pointer);
+    if(vote == 1){
+    //  Serial.println("1");
+      video1Votes++;
+      String votes = (String)video1Votes;
+      votes += "^";
+      votes += video2Votes;
+      Serial.println(votes);
+      while(!pushMessage(pusher_channel, "Vote", votes)) {
+      }
+    }
+    else if(vote == 2){
+  //    Serial.println("2");
+      video2Votes++;
+      String votes = (String)video1Votes;
+      votes += "^";
+      votes += video2Votes;
+      Serial.println(votes);
+      while(!pushMessage(pusher_channel, "Vote", votes)) {
+      }
+    }
+  }
+  else{
+  //  Serial.println("ERROR: " + data);
+  }
+}
+
+boolean pushMessage(String channel, String event, String data){
+  if(arisClient.connect(aris, 80)){
+    String request = "GET /server/pusher/public_send.php?channel="; //change when updated
+    request += channel;
+    request += "&event=";
+    request += event;
+    request += "&data=";
+    request += data;
+    request += " HTTP/1.0";
+    arisClient.println(request);
+    arisClient.println();
+    arisClient.stop();
+    return true;
+  }
+  return false;
+}
+


add gyro_samprate sketch use to measure gyro sensor sample rates

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

--- gyro_samprate/gyro_samprate.ino
+++ gyro_samprate/gyro_samprate.ino
@@ -0,0 +1,63 @@
+/*
+To measure the sample rate of the sensor:
+1. Discard sample
+2. Poll sensor until next sample is ready.
+   Discard again because this might be immediately after clearing the 1st sample.
+3. Wait until next sample; this will be long enough that once the next sample is ready,
+   the time can be taken.
+4. Take time after next sample; initialize count to 1.
+5. Keep counting samples for 1 minute.
+6. Every minute the Arduino will print number of samples per minute.
+   Divide this by 60 to obtain samples per second.
+
+   Results:
+   unmarked sensor: 11283 Sa/min = 188.05 Sa/s
+   marked sensor: 11018 Sa/min = 183.63 Sa/s
+*/
+
+#include <Wire.h>
+#include <L3G.h>
+
+const byte ZYXDA = 1 << 3;
+
+L3G gyro;
+
+void setup() {
+  Serial.begin(9600);
+  Wire.begin();
+
+  if (!gyro.init())
+  {
+    Serial.println("Failed to autodetect gyro type!");
+    while (1);
+  }
+
+  gyro.enableDefault();
+}
+
+void loop() {
+  //Discard sample
+  gyro.read()
+  //Wait until next new sample
+  while(!gyro_data_ready());
+  //Discard sample
+  gyro.read()
+  //The Arduino has definitely "caught up" and can wait until next new sample
+  while(!gyro_data_ready());
+  //Get time immediately after 1st sample is ready
+  long start_time = millis();
+  gyro.read();
+  int read_count = 1;
+  //Count number of samples for 1 minute (60000ms)
+  while(millis() < start_time + 60000){
+    while(!gyro_data_ready());
+    gyro.read();
+    read_count++;
+  }
+  Serial.println(read_count);
+}
+
+bool gyro_data_ready(){
+    return (gyro.readReg(L3G::STATUS) & ZYXDA) == ZYXDA;
+}
+


Update interrupt example to not use LowPower library by default.

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/leftbrainstrain/Adafruit-MCP23017-Arduino-Library.git/'


update

update

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/relayr/blog.git/'


Working version of proof-of-concept 6 key matrix (3x2)

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

--- sketches/test_6keys/test_6keys.ino
+++ sketches/test_6keys/test_6keys.ino
@@ -0,0 +1,114 @@
+/*
+ Test a six-key matrix with 3 keys in two ranks.
+
+ Turns on a LED when ANY two keys are pressed simultaneously.
+
+ The circuit:
+ * LED built in to pin 13, connected to ground
+ * Key matrix: C, C#, and D from two keyboards
+   * C into digital pin 8
+   * C# into digital pin 9
+   * D into digital pin 10
+   * Internal pull-up resistors activated for all inputs
+ * Keyboard 0 - pin 69 (analog 15)
+ * Keyboard 1 - pin 68 (analog 14)
+ * Six diodes allowing facing away from the inputs (allowing
+   current to be sunk, and hence inputs pulled down,
+   but open circuit otherwise)
+
+ created 2016 by @JDWarner
+*/
+
+// constants won't change. They're used here to
+// set pin numbers:
+const int keyPin0 = 8;           // pin from organ key C
+const int keyPin1 = 9;           // pin from organ key C#
+const int keyPin2 = 10;          // pin from organ key D
+const int ledPin = LED_BUILTIN;  // LED pin
+const int drivePin0 = 69;        // Drive pin for rank 0
+const int drivePin1 = 68;        // Drive pin for rank 1
+
+// define how large some things are (matrix size)
+const int numKeys = 3;
+const int numRanks = 2;
+
+// State of all keys in a 2D multidimensional array
+bool keyStates[numRanks][numKeys] = {
+  {false,  false,  false},
+  {false,  false,  false},
+};
+
+// Reading of all keys for a particular loop
+bool keyReads[] = {false, false, false};
+int keyPins[] = {8, 9, 10};
+int rankPins[] = {69, 68};
+int activeKeys = 0;
+
+// simple function to compare current state with new read
+// if different, state and LED are updated
+// We're using input_pullup so the switch is active when LOW!
+// Note: Internally changing `state` requires call-by-reference
+void pinChange(bool value, bool &state, int pin) {
+  // Compare them - `state` records inverse of switch read
+  if (value == state) { // Equal means a change
+
+    // Update values as needed, if needed
+    state = not value;
+
+    // Do something here - MIDI event, or turn on LED with
+    // digitalWrite(ledPin, state);
+  }
+}
+
+
+// function to handle the loop over a given rank, updating states
+void rankPoll(int keyPins[numKeys], bool (&states)[numKeys]) {
+  for(int key=0; key<numKeys; key++){
+      // states[key] = not digitalRead(keyPins[key]);
+      pinChange(digitalRead(keyPins[key]), states[key], keyPins[key]);
+  }
+}
+
+
+void setup() {
+  // initialize the LED pin and drivers as outputs
+  pinMode(ledPin, OUTPUT);
+  pinMode(drivePin0, OUTPUT);
+  pinMode(drivePin1, OUTPUT);
+
+  // start driver pins HIGH (off)
+  digitalWrite(drivePin0, HIGH);
+  digitalWrite(drivePin1, HIGH);
+
+  // initialize the organ keys' pins as inputs
+  pinMode(keyPin0, INPUT_PULLUP);
+  pinMode(keyPin1, INPUT_PULLUP);
+  pinMode(keyPin2, INPUT_PULLUP);
+}
+
+
+void loop() {
+  // read the state of the key value:
+  for(int rank = 0; rank < numRanks; rank++){
+      digitalWrite(rankPins[rank], LOW);
+      rankPoll(keyPins, keyStates[rank]);
+      digitalWrite(rankPins[rank], HIGH);
+   }
+
+  // sum up total active keys
+  activeKeys = 0;
+  for(int rank=0; rank<numRanks; rank++){
+      for(int key=0; key<numKeys; key++){
+          if (keyStates[rank][key] == true) {
+            activeKeys++;
+          }
+      }
+  }
+
+  // Activate LED if correct # of keys pressed
+  if(activeKeys == 2){
+      digitalWrite(ledPin, HIGH);
+  } else {
+      digitalWrite(ledPin, LOW);
+  }
+}


removes prints from serial

removes prints from serial

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


Adding example

Adding example

error: pathspec 'arduino/libraries/Sparkfun7SD-Serial/examples/Serial7SD.ino' did not match any file(s) known to git

--- arduino/libraries/Sparkfun7SD-Serial/examples/Serial7SD.ino
+++ arduino/libraries/Sparkfun7SD-Serial/examples/Serial7SD.ino
@@ -0,0 +1,19 @@
+#include <Sparkfun7SD_Serial.h>
+
+// initialize the display on TX pin 8
+Sparkfun7SD_Serial display7s(8);
+
+void setup() {
+    display7s.begin();
+    display7s.brightness(255);
+}
+
+void loop() {
+    display7s.clear();
+
+    display7s.print("1234");
+    delay(1000);
+
+    display7s.printTime(12, 30, true);
+    delay(1000);
+}


Update ProbeCubeGeiger0221.ino

Update ProbeCubeGeiger0221.ino

error: pathspec 'Arduino' did not match any file(s) known to git
error: pathspec 'with' did not match any file(s) known to git
error: pathspec 'cc3000wifi' did not match any file(s) known to git
error: pathspec 'based/Gieger_module/code/ProbeCubeGeiger0221.ino' did not match any file(s) known to git


Adds _very_ expirimental support for using DIO0 instead of DIO2.

Uses the CRC ready and Packet sent interrupts instead of the automode interrupt.

Still uses the automode system for efficiency in the radio module, only alerts
the MCU to changes via another interrupt.

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

--- examples/MinimalInterruptUnoDIO0/MinimalInterruptUnoDIO0.ino
+++ examples/MinimalInterruptUnoDIO0/MinimalInterruptUnoDIO0.ino
@@ -0,0 +1,148 @@
+/*
+ *  Copyright (c) 2015, Ivor Wanders
+ *  MIT License, see the LICENSE.md file in the root folder.
+*/
+
+#include <SPI.h>
+#include <plainRFM69.h>
+
+// slave select pin.
+#define SLAVE_SELECT_PIN 10
+
+// connected to the reset pin of the RFM69.
+#define RESET_PIN 8
+// Sometimes required? Perhaps registers in RFM don't properly initialize after
+// power is switched on and proper reset is required?
+
+// tie this pin down on the receiver.
+#define SENDER_DETECT_PIN A0
+
+// Pin DIO 0 on the RFM69 is attached to this digital pin.
+// Pin should have interrupt capability.
+#define DIO0_PIN 2
+
+// on Arduino UNO the the pin number is not what's given to attachInterrupt(..)
+#define INTERRUPT_NUMBER 0
+// On the Arduino UNO pin 2 has interrupt number 0.
+
+/*
+    This is a minimal example with the interrupt to call poll().
+
+    It transmits a 4 byte integer every 500 ms.
+
+    ====================================================
+            Using DIO0 is HIGHLY expirimental!
+    ====================================================
+*/
+
+plainRFM69 rfm = plainRFM69(SLAVE_SELECT_PIN);
+
+
+void sender(){
+
+    uint32_t start_time = millis();
+
+    uint32_t counter = 0; // the counter which we are going to send.
+
+    while(true){
+        if (!rfm.canSend()){
+            continue; // sending is not possible, already sending.
+        }
+
+        if ((millis() - start_time) > 500){ // every 500 ms.
+            start_time = millis();
+
+            // be a little bit verbose.
+            Serial.print("Send:");Serial.println(counter);
+
+            // send the number of bytes equal to that set with setPacketLength.
+            // read those bytes from memory where counter starts.
+            rfm.send(&counter);
+
+            counter++; // increase the counter.
+        }
+
+    }
+}
+
+void receiver(){
+    uint32_t counter = 0; // to count the messages.
+
+    while(true){
+        while(rfm.available()){ // for all available messages:
+
+            uint32_t received_count = 0; // temporary for the new counter.
+            uint8_t len = rfm.read(&received_count); // read the packet into the new_counter.
+
+            // print verbose output.
+            Serial.print("Packet ("); Serial.print(len); Serial.print("): ");Serial.println(received_count);
+
+            if (counter+1 != received_count){
+                // if the increment is larger than one, we lost one or more packets.
+                Serial.println("Packetloss detected!");
+            }
+
+            // assign the received counter to our counter.
+            counter = received_count;
+        }
+    }
+}
+
+void interrupt_RFM(){
+    rfm.poll(); // in the interrupt, call the poll function.
+}
+
+void setup(){
+    Serial.begin(9600);
+    SPI.begin();
+
+    bareRFM69::reset(RESET_PIN); // sent the RFM69 a hard-reset.
+
+    rfm.setRecommended(); // set recommended paramters in RFM69.
+    rfm.setPacketType(false, false); // set the used packet type.
+
+    rfm.setBufferSize(2);   // set the internal buffer size.
+    rfm.setPacketLength(4); // set the packet length.
+    rfm.setFrequency((uint32_t) 434*1000*1000); // set the frequency.
+
+    // baudrate is default, 4800 bps now.
+
+    rfm.receive();
+    // set it to receiving mode.
+
+    /*
+        setup up interrupts such that we don't have to call poll() in a loop.
+    */
+
+    // tell the RFM to set DIO0 when the CRC is ok and when a packet has been sent.
+    rfm.setDioMapping1(RFM69_PACKET_DIO_0_RX_CRC_OK | RFM69_PACKET_DIO_0_TX_PACKET_SENT);
+
+    // set pinmode to input.
+    pinMode(DIO0_PIN, INPUT);
+
+    // Tell the SPI library we're going to use the SPI bus from an interrupt.
+    SPI.usingInterrupt(INTERRUPT_NUMBER);
+
+    // hook our interrupt function to any edge.
+    attachInterrupt(INTERRUPT_NUMBER, interrupt_RFM, CHANGE);
+
+    // start receiving.
+    rfm.receive();
+
+    pinMode(SENDER_DETECT_PIN, INPUT_PULLUP);
+    delay(5);
+}
+
+void loop(){
+    if (digitalRead(SENDER_DETECT_PIN) == LOW){
+        Serial.println("Going Receiver!");
+        receiver();
+        // this function never returns and contains an infinite loop.
+    } else {
+        Serial.println("Going sender!");
+        sender();
+        // idem.
+    }
+}
+
+


Blue Tooth Low energy working again.

Blue Tooth Low energy working again.

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


change callc to macro

change callc to macro

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


Added a MidiPots example, using USB Midi and Pots module.

error: pathspec 'arduino/libraries/BuildingBlocks/examples/MidiPots/MidiPots.ino' did not match any file(s) known to git

--- arduino/libraries/BuildingBlocks/examples/MidiPots/MidiPots.ino
+++ arduino/libraries/BuildingBlocks/examples/MidiPots/MidiPots.ino
@@ -0,0 +1,44 @@
+// https://github.com/BlokasLabs/usbmidi
+
+// Mainboard with Pots module connected to SV1.
+
+#include <PluggableUSB.h>
+#include <usbmidi.h>
+
+#include <spi.h>
+#include <BuildingBlocks.h>
+
+Pots pots;
+Mainboard mainboard(pots);
+
+void setup() {
+	Serial.begin(9600);
+	mainboard.init();
+	pots.setCallback(&onPotCallback);
+}
+
+void onPotCallback(uint8_t pot, uint16_t value) {
+	sendCC(0, pot, value >> 3);
+}
+
+void sendCC(uint8_t channel, uint8_t control, uint8_t value) {
+	USBMIDI.write(0xB0 | (channel & 0xf));
+	USBMIDI.write(control & 0x7f);
+	USBMIDI.write(value & 0x7f);
+}
+
+void loop() {
+	while (USBMIDI.available()) {
+		u8 b = USBMIDI.read();
+	}
+
+	mainboard.update();
+	USBMIDI.flush();
+
+	for (int i=0; i<4; ++i)
+	{
+		Serial.print(pots.getValue(i), DEC);
+		Serial.write(' ');
+	}
+	Serial.write('\n');
+}


Sends Analog value via RS232 Using the Protocol $VOLTAGE,A1,<floatValue>

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

--- arduino_src/SerialSendAnalogVoltage/SerialSendAnalogVoltage.ino
+++ arduino_src/SerialSendAnalogVoltage/SerialSendAnalogVoltage.ino
@@ -0,0 +1,29 @@
+
+// the setup routine runs once when you press reset:
+void setup() {
+  // initialize serial communication at 9600 bits per second:
+   Serial.begin(9600);
+   //--
+   pinMode(14,  OUTPUT );  // Left leg of potentiomenter
+                           // A1 is the Midle leg is input
+   pinMode(16,  OUTPUT );  // Right leg of potentiomenter
+   digitalWrite(14,LOW);   //
+   digitalWrite(16,HIGH);  //
+}
+
+// the loop routine runs over and over again forever:
+void loop() {
+  float oldVoltage=-1;
+  while(true)
+  { // read the input on analog pin 0:
+    int sensorValue = analogRead(A1);
+    // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
+    float voltage = sensorValue * (5.0 / 1023.0);
+    if(voltage!=oldVoltage) //Transfer voltage on change
+    {
+      //Transfer the serial data
+      Serial.print("$VOLTAGE,A1," );
+      Serial.println(voltage);
+    }//end if
+  }//end while
+}


Create handControl.ino

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


Refactoring and Issue #4 Avoid battery drain

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/franciscoalario/GoldenAnt.git/'


added hellomesh_oled

added hellomesh_oled

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

--- Arduino/HelloMesh_OLED/HelloMesh_OLED.ino
+++ Arduino/HelloMesh_OLED/HelloMesh_OLED.ino
@@ -0,0 +1,79 @@
+// Based on the HelloMesh Example
+// Add OLED for debugging messages
+// I have two identical NodeMCUs, both programmed the same, yet one runs slower than the other?
+
+
+#include <ESP8266WiFi.h>
+#include <ESP8266WiFiMesh.h>
+
+#include <SPI.h>
+#include <Wire.h>
+#include <Adafruit_GFX.h>
+#include <Adafruit_SSD1306.h>
+
+#define OLED_RESET LED_BUILTIN //4
+Adafruit_SSD1306 display(OLED_RESET);
+
+unsigned int request_i = 0;
+unsigned int response_i = 0;
+
+String manageRequest(String request);
+
+/* Create the mesh node object */
+ESP8266WiFiMesh mesh_node = ESP8266WiFiMesh(ESP.getChipId(), manageRequest);
+
+/**
+ * Callback for when other nodes send you data
+ *
+ * @request The string received from another node in the mesh
+ * @returns The string to send back to the other node
+ */
+String manageRequest(String request)
+{
+	/* Print out received message */
+	Serial.print("received: ");
+	Serial.println(request);
+
+	/* return a string to send back */
+	char response[60];
+	sprintf(response, "Hello world response #%d from Mesh_Node%d.", response_i++, ESP.getChipId());
+	return response;
+}
+
+void setup(){
+  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
+  display.clearDisplay();
+  display.display();
+  display.setTextSize(1);
+  display.setTextColor(WHITE);
+  /*
+	Serial.begin(115200);
+	delay(10);
+
+	Serial.println();
+	Serial.println();
+	Serial.println("Setting up mesh node...");
+
+	/* Initialise the mesh node */
+	mesh_node.begin();
+}
+
+void loop()
+{
+	/* Accept any incoming connections */
+	mesh_node.acceptRequest();
+
+	/* Scan for other nodes and send them a message */
+	char request[60];
+	sprintf(request, "Hello world request #%d from Mesh_Node%d.", request_i++, ESP.getChipId());
+
+  display.clearDisplay();
+  display.setCursor(0,0);
+  display.println("Hello World!");
+  display.setCursor(0,16);
+  display.println(request);
+  display.display();
+
+	mesh_node.attemptScan(request);
+	delay(1000);
+}


Add Microduino/mCookie Bluetooth LE

Add Microduino/mCookie Bluetooth LE

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

--- examples/Boards_Bluetooth/Microduino_BLE/Microduino_BLE.ino
+++ examples/Boards_Bluetooth/Microduino_BLE/Microduino_BLE.ino
@@ -0,0 +1,47 @@
+/**************************************************************
+ * Blynk is a platform with iOS and Android apps to control
+ * Arduino, Raspberry Pi and the likes over the Internet.
+ * You can easily build graphic interfaces for all your
+ * projects by simply dragging and dropping widgets.
+ *
+ *   Downloads, docs, tutorials: http://www.blynk.cc
+ *   Blynk community:            http://community.blynk.cc
+ *   Social networks:            http://www.fb.com/blynkapp
+ *                               http://twitter.com/blynk_app
+ *
+ * Blynk library is licensed under MIT license
+ * This example code is in public domain.
+ *
+ **************************************************************
+ *
+ * This example shows how to use Microduino/mCookie Bluetooth LE
+ * to connect your project to Blynk.
+ *
+ * NOTE: BLE support is in beta!
+ *
+ **************************************************************/
+
+// For CoreUSB, use Serial for debug output
+#define BLYNK_PRINT Serial
+//#define BLYNK_USE_DIRECT_CONNECT
+#include <BlynkSimpleSerialBLE.h>
+
+// You should get Auth Token in the Blynk App.
+// Go to the Project Settings (nut icon).
+char auth[] = "YourAuthToken";
+
+void setup()
+{
+  // Debug console
+  Serial.begin(9600);
+
+  // Blynk will work through Serial1
+  Serial1.begin(9600);
+  Blynk.begin(auth, Serial1);
+}
+
+void loop()
+{
+  Blynk.run();
+}
+


First rover program

First rover program

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

--- rover/rover.ino
+++ rover/rover.ino
@@ -0,0 +1,55 @@
+#include "variant.h"
+#include <stdio.h>
+#include <adk.h>
+#include "DualMC33926MotorShield.h"
+
+#define BUFFSIZE   128
+#define MAX_POWER  400
+#define MIN_POWER -400
+
+// Accessory descriptor. It's how Arduino identifies itself in Android.
+char accessoryName[] = "UDOO Silkworm jeep";
+char manufacturer[] = "Example, Inc.";
+char model[] = "UDOO-Silkworm";
+
+char versionNumber[] = "0.1.0";
+char serialNumber[] = "1";
+char url[] = "http://www.example.com";
+
+// ADK configuration
+USBHost Usb;
+ADK adk(&Usb, manufacturer, model, accessoryName, versionNumber, url, serialNumber);
+uint8_t buffer[BUFFSIZE];
+uint32_t bytesRead = 0;
+
+// MC33926 motor shield configuration
+DualMC33926MotorShield motor;
+
+void setup() {
+  cpu_irq_enable();
+  Serial.begin(115200);
+  Serial.println("All power to the engines!");
+  delay(2000);
+
+  motor.init();
+}
+
+void loop() {
+  Usb.Task();
+
+  // Starting listening when ADK is available
+  if (adk.isReady()) {
+      adk.read(&bytesRead, BUFFSIZE, buffer);
+    if (bytesRead > 0) {
+      jeepCommandInterpreter(buffer[0]);
+    }
+  }
+}
+
+void jeepCommandInterpreter(uint8_t command) {
+  switch(command) {
+    default:
+      Serial.println("Command not available");
+      break;
+  }
+}


First commit to master

First commit to master

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

--- arduino/autofowl.ino
+++ arduino/autofowl.ino
@@ -0,0 +1,478 @@
+#include <EEPROM.h>
+#include <LiquidCrystal.h>
+#include <Stepper.h>
+#include <AccelStepper.h>
+
+const int INT_MAX = 32767;
+const int NONE = -1;
+const int TICK = 150; // microseconds
+
+const int BUTTON_UP = LOW;
+const int BUTTON_DOWN = HIGH;
+
+// Run modes
+const int MODE_DISABLED         = 0;
+const int MODE_AUTO             = 1;
+const int MODE_MANUAL           = 2;
+const int MODE_SET_CLOSE_THRESH = 3;
+const int MODE_SET_OPEN_THRESH  = 4;
+const int MODE_MIN              = MODE_DISABLED;
+const int MODE_MAX              = MODE_SET_OPEN_THRESH;
+
+// Door positions
+const int DOOR_POSITION_UNKNOWN = 0;
+const int DOOR_POSITION_UP      = 1;
+const int DOOR_POSITION_DOWN    = 2;
+const int DOOR_POSITION_MAX     = DOOR_POSITION_DOWN;
+const int DOOR_POSITION_MIN     = DOOR_POSITION_UNKNOWN;
+
+// Door motion directions
+const int DOOR_STATIONARY       = 0;
+const int DOOR_MOVING_UP        = 1;
+const int DOOR_MOVING_DOWN      = 2;
+
+// EEPROM addresses
+const int DOOR_POSITION_ADDRESS     = 0;
+const int CURRENT_MODE_ADDRESS      = 1;
+const int LIGHT_THRESH_DOWN_ADDRESS = 3;
+const int LIGHT_THRESH_UP_ADDRESS   = 4;
+const int EEPROM_UNSET              = 255;
+
+// Motor constants
+const int MOTOR_RPMS            = 60;
+
+// Number of ticks beyond threshold to wait before changing door position
+const int LIGHT_THRESH_TICKS_TO_CHANGE = 100;
+
+// Motor constants
+const int STEPS_PER_REVOLUTION = 200;
+
+// Door-specific constants
+// Number of revolutions to fully change door position
+const int REVOLUTIONS_TO_CHANGE   = 100;
+
+// Pins
+// Arduino Uno / Buttons
+const int PIN_MODE_BUTTON = 8;
+const int PIN_UP_BUTTON   = 10;
+const int PIN_DOWN_BUTTON = 9;
+// Arduino Uno / LCD screen
+const int PIN_LCD_RS      = 12;
+const int PIN_LCD_ENABLE  = 11;
+const int PIN_LCD_D4      = 5;
+const int PIN_LCD_D5      = 4;
+const int PIN_LCD_D6      = 3;
+const int PIN_LCD_D7      = 2;
+// Arduino Uno / Photocell
+const int PIN_PHOTOCELL   = A0;
+// Arduino Uno / Motor controller
+const int PIN_MOTOR_1     = A1; // pin 2 on L293D
+const int PIN_MOTOR_2     = A2; // pin 7 on L293D
+const int PIN_MOTOR_3     = A3; // pin 15 on L293D
+const int PIN_MOTOR_4     = A4; // pin 10 on L293D
+
+// Global State variables
+int CurrentMode           = MODE_AUTO;
+int DoorPosition          = DOOR_POSITION_UNKNOWN;
+int DoorDirection         = DOOR_STATIONARY;
+// Used for detecting button presses
+int UpButtonState         = BUTTON_UP;
+int UpButtonLastState     = BUTTON_UP;
+int DownButtonState       = BUTTON_UP;
+int DownButtonLastState   = BUTTON_UP;
+int ModeButtonState       = BUTTON_UP;
+int ModeButtonLastState   = BUTTON_UP;
+// Used for light sensor
+int LightCurrent          = 0;             // Current reading
+int LightLast             = LightCurrent;  // Last reading
+int LightThreshUp         = 100;
+int LightThreshDown       = 10;
+int LightThreshTicks      = 0;              // Ticks needed to start door position change
+
+// Initialize the LCD
+LiquidCrystal Lcd(PIN_LCD_RS, PIN_LCD_ENABLE, PIN_LCD_D4, PIN_LCD_D5, PIN_LCD_D6, PIN_LCD_D7);
+
+// Initialize the stepper motor controller
+AccelStepper Motor(AccelStepper::FULL4WIRE, PIN_MOTOR_1, PIN_MOTOR_2, PIN_MOTOR_3, PIN_MOTOR_4, true);
+
+void setup() {
+
+  // initialize serial and wait for port to open:
+  Serial.begin(9600);
+  while (!Serial) {
+    ; // wait for serial port to connect. Needed for native USB port only
+  }
+
+  // Set up pins
+  pinMode(PIN_MODE_BUTTON,  INPUT);
+  pinMode(PIN_UP_BUTTON,    INPUT);
+  pinMode(PIN_DOWN_BUTTON,  INPUT);
+  pinMode(PIN_PHOTOCELL,    INPUT);
+  pinMode(PIN_MOTOR_1,      OUTPUT);
+  pinMode(PIN_MOTOR_2,      OUTPUT);
+  pinMode(PIN_MOTOR_3,      OUTPUT);
+  pinMode(PIN_MOTOR_4,      OUTPUT);
+
+  // set up the LCD's number of columns and rows:
+  Lcd.begin(16, 2);
+  // Print a message to the LCD.
+  Lcd.print("eCoop v2.0");
+
+  // Set up the motor
+  Motor.setSpeed( ( MOTOR_RPMS / 60 ) * STEPS_PER_REVOLUTION );
+
+  // Read door position from eeprom
+  DoorPosition = EEPROM.read(DOOR_POSITION_ADDRESS);
+  // Detect bad eeprom values and fix
+  if ( DoorPosition > DOOR_POSITION_MAX || DoorPosition < DOOR_POSITION_MIN ) {
+    DoorPosition = DOOR_POSITION_UNKNOWN;
+    EEPROM.write(DOOR_POSITION_ADDRESS, DOOR_POSITION_UNKNOWN);
+  }
+  // Handle DoorPosition == DOOR_POSITION_UNKNOWN or never set
+  if (DoorPosition == DOOR_POSITION_UNKNOWN || DoorPosition == EEPROM_UNSET ) {
+    CurrentMode = MODE_MANUAL;
+  }
+
+  // Read current mode from eeprom
+  CurrentMode = EEPROM.read(CURRENT_MODE_ADDRESS);
+  // Make sure value is in legal range. If not, fall back to AUTO mode
+  if (CurrentMode > MODE_MAX || CurrentMode < MODE_MIN ) {
+    CurrentMode = MODE_AUTO;
+  }
+
+  delay(1000);
+  updateLCD();
+}
+
+void loop() {
+
+  // Handle pressed buttons
+  handleButton();
+
+  handleLight();
+
+  // Sleep to avoid busy wait
+  delay(TICK);
+}
+
+void handleButton() {
+  int button = pressedButton();
+  if ( button == PIN_MODE_BUTTON ) {
+    nextMode();
+    updateLCD();
+  } else if ( button == PIN_UP_BUTTON ) {
+    handleButtonUp();
+    updateLCD();
+  } else if ( button == PIN_DOWN_BUTTON ) {
+    handleButtonDown();
+    updateLCD();
+  }
+}
+
+// Returns code of button that has been pressed, if any
+int pressedButton() {
+  // Look at MODE button
+  ModeButtonState = digitalRead(PIN_MODE_BUTTON);
+  if ( ModeButtonState == BUTTON_DOWN && ModeButtonState != ModeButtonLastState ) {
+    ModeButtonLastState = ModeButtonState;
+    return PIN_MODE_BUTTON;
+  }
+  ModeButtonLastState = ModeButtonState;
+  // Look at UP button
+  UpButtonState = digitalRead(PIN_UP_BUTTON);
+  if ( UpButtonState == BUTTON_DOWN && UpButtonState != UpButtonLastState ){
+    UpButtonLastState = UpButtonState;
+    return PIN_UP_BUTTON;
+  }
+  UpButtonLastState = UpButtonState;
+  // Look at MODE pin
+  DownButtonState = digitalRead(PIN_DOWN_BUTTON);
+  if ( DownButtonState == BUTTON_DOWN && DownButtonState != DownButtonLastState ){
+    DownButtonLastState = DownButtonState;
+    return PIN_DOWN_BUTTON;
+  }
+  DownButtonLastState = DownButtonState;
+  return NONE;
+}
+
+void nextMode() {
+  CurrentMode++;
+  if ( CurrentMode > MODE_MAX ) {
+    CurrentMode = MODE_MIN;
+  }
+  // Save mode to memory
+  EEPROM.write(CURRENT_MODE_ADDRESS, CurrentMode);
+
+  // Clean up after for AUTO mode
+  if ( CurrentMode != MODE_AUTO )  {
+    LightThreshTicks = 0;
+  }
+
+  // Clean up after MANUAL mode
+  if ( CurrentMode != MODE_MANUAL )  {
+    if ( doorIsMoving() ) {
+      stopDoor();
+    }
+  }
+}
+
+void handleButtonUp() {
+  if ( CurrentMode == MODE_MANUAL ) {
+    if ( DoorDirection == DOOR_STATIONARY ) {
+      // Move door UP since we are in manual mode
+      moveDoorUp(INT_MAX);
+    } else {
+      // Set the door position to UP and stop moving
+      DoorPosition = DOOR_POSITION_UP;
+      stopDoor();
+    }
+  } else if ( CurrentMode == MODE_SET_OPEN_THRESH ) {
+    LightThreshUp++;
+    Serial.print("MODE_SET_OPEN_THRESH ");
+    Serial.println(LightThreshUp);
+  } else if ( CurrentMode == MODE_SET_CLOSE_THRESH ) {
+    LightThreshDown++;
+    Serial.print("MODE_SET_CLOSE_THRESH ");
+    Serial.println(LightThreshDown);
+  }
+}
+
+void handleButtonDown() {
+  if ( CurrentMode == MODE_MANUAL ) {
+    if ( DoorDirection == DOOR_STATIONARY ) {
+      // Move door DOWN since we are in manual mode
+      moveDoorDown(INT_MAX);
+    } else {
+      // Door was not stationary so set current position to DOWN and stop it
+      DoorPosition = DOOR_POSITION_DOWN;
+      stopDoor();
+    }
+  } else if ( CurrentMode == MODE_SET_OPEN_THRESH ) {
+    LightThreshUp = LightThreshUp - 1;
+    Serial.print("MODE_SET_OPEN_THRESH ");
+    Serial.println(LightThreshUp);
+  } else if ( CurrentMode == MODE_SET_CLOSE_THRESH ) {
+    LightThreshDown = LightThreshDown - 1;
+    Serial.print("MODE_SET_CLOSE_THRESH ");
+    Serial.println(LightThreshDown);
+  }
+}
+
+void handleLight() {
+
+  updateLight();
+
+  if ( LightLast != LightCurrent ) {
+    updateLCD();
+  }
+
+  // Keep going only if we are in AUTO mode
+  if ( CurrentMode != MODE_AUTO ) {
+    return;
+  }
+
+  // Determine if door should move up or down
+  if ( LightCurrent > LightThreshUp ) {
+
+    // See if we could potentially change door position
+    // If not, there's nothing else to do here
+    if ( DoorPosition == DOOR_POSITION_UP ) {
+      return;
+    }
+
+    LightThreshTicks++;
+    updateLCD();
+    if ( LightThreshTicks > LIGHT_THRESH_TICKS_TO_CHANGE ) {
+      // Start moving up
+      openDoor();
+      // Done moving door so reset ticks
+      LightThreshTicks = 0;
+    }
+  } else if ( LightCurrent < LightThreshDown ) {
+
+    // See if we could potentially change door position
+    // If not, there's nothing else to do here
+    if ( DoorPosition == DOOR_POSITION_DOWN ) {
+      return;
+    }
+
+    LightThreshTicks++;
+    updateLCD();
+    if ( LightThreshTicks > LIGHT_THRESH_TICKS_TO_CHANGE ) {
+      // Start moving down
+      closeDoor();
+      // Done moving door so reset ticks
+      LightThreshTicks = 0;
+    }
+  } else {
+    LightThreshTicks = 0;
+  }
+}
+
+// Read light sensor and set global var
+void updateLight() {
+  LightLast = LightCurrent;
+  LightCurrent = analogRead(PIN_PHOTOCELL);
+}
+
+void openDoor() {
+  // If door is already up, just return
+  if ( DoorPosition == DOOR_POSITION_UP ) {
+    return;
+  }
+  moveDoorUp(REVOLUTIONS_TO_CHANGE);
+}
+
+void closeDoor() {
+  // If door is already down, just return
+  if ( DoorPosition == DOOR_POSITION_DOWN ) {
+    return;
+  }
+  moveDoorDown(REVOLUTIONS_TO_CHANGE);
+}
+
+void moveDoorUp(int revolutions) {
+  updateDoorStatus(DOOR_MOVING_UP, DOOR_POSITION_UNKNOWN);
+  moveDoor(revolutions);
+  updateDoorStatus(DOOR_STATIONARY, DOOR_POSITION_UP);
+}
+
+// Start moving door down
+void moveDoorDown(int revolutions) {
+  updateDoorStatus(DOOR_MOVING_DOWN, DOOR_POSITION_UNKNOWN);
+  moveDoor(-revolutions);
+  updateDoorStatus(DOOR_STATIONARY, DOOR_POSITION_DOWN);
+}
+
+// Moves door either up or down.
+// If revolutions is positive, door goes up; if negative, door goes down.
+void moveDoor(int revolutions) {
+  // Set the motor target position i.e. number of steps to move
+  Motor.move(revolutions * (long) STEPS_PER_REVOLUTION);
+
+  // Start stepping motor
+  // for (int rev = 1; rev <= revolutions; rev++) {
+  while (true) {
+
+    // Handle buttons to allow abort
+    handleButton();
+
+    // Eject from loop if we stopped the door manually
+    if ( DoorDirection == DOOR_STATIONARY ) {
+      // Reset the stepper library
+      break;
+    }
+
+    // Step motor and check if we should loop again
+    bool stillRunning = Motor.run();
+    if ( ! stillRunning )  {
+      break;
+    }
+  }
+}
+
+// Stop door motion
+void stopDoor() {
+  // Update status
+  DoorDirection = DOOR_STATIONARY;
+  EEPROM.write(DOOR_POSITION_ADDRESS, DoorPosition);
+}
+
+bool doorIsMoving() {
+  return ( DoorDirection != DOOR_STATIONARY );
+}
+
+void updateDoorStatus(int doorMoving, int doorPosition) {
+  DoorDirection = doorMoving;
+  DoorPosition = doorPosition;
+  EEPROM.write(DOOR_POSITION_ADDRESS, doorPosition);
+  updateLCD();
+}
+
+// Update LCD with current status
+void updateLCD() {
+
+  Lcd.clear();
+
+  if ( CurrentMode <= MODE_MANUAL && CurrentMode >= MODE_DISABLED ) {
+    // Render run mode
+
+    // Print first line
+
+    Lcd.print("Mode: ");
+    Lcd.print(prettyMode());
+
+    Lcd.print(" Door: ");
+    Lcd.print(prettyDoorPosition());
+
+    // Render second line
+    Lcd.setCursor(0, 1);
+    Lcd.print(LightThreshDown);
+    Lcd.setCursor(5, 1);
+    Lcd.print(LightCurrent);
+    Lcd.setCursor(10, 1);
+    Lcd.print(LightThreshUp);
+    Lcd.setCursor(15, 1);
+    char doorDirection = prettyDoorDirection();
+    int ticksToChange = prettyTicksToChange();
+    if (doorDirection == ' ' && ticksToChange > 0 && ticksToChange < 10 ) {
+      Lcd.print(prettyTicksToChange());
+    } else {
+      Lcd.print(doorDirection);
+    }
+
+  } else {
+    // Render settings
+
+    // Render first line
+    Lcd.print("Set: ");
+    if ( CurrentMode == MODE_SET_OPEN_THRESH ) {
+      Lcd.print("Open Threshold");
+    } else if ( CurrentMode == MODE_SET_CLOSE_THRESH ) {
+      Lcd.print("Close Threshold");
+    }
+
+    // Render second line
+    Lcd.setCursor(0, 1);
+    if ( CurrentMode == MODE_SET_OPEN_THRESH ) {
+      Lcd.print(LightThreshUp);
+    } else if ( CurrentMode == MODE_SET_CLOSE_THRESH ) {
+      Lcd.print(LightThreshDown);
+    }
+  }
+}
+
+char prettyMode() {
+  if ( CurrentMode == MODE_DISABLED ) {
+    return '0';
+  } else if ( CurrentMode == MODE_AUTO ) {
+    return 'A';
+  } else if ( CurrentMode == MODE_MANUAL ) {
+    return 'M';
+  }
+  return ' ';
+}
+
+char prettyDoorDirection() {
+  if ( DoorDirection == DOOR_MOVING_UP ) {
+    return 'U';
+  } else if ( DoorDirection == DOOR_MOVING_DOWN ) {
+    return 'D';
+  }
+  return ' ';
+}
+
+char prettyDoorPosition() {
+  if ( DoorPosition == DOOR_POSITION_UNKNOWN ) {
+    return '?';
+  } else if ( DoorPosition == DOOR_POSITION_UP ) {
+    return 'U';
+  } else if ( DoorPosition == DOOR_POSITION_DOWN ) {
+    return 'D';
+  }
+  return ' ';
+}
+
+int prettyTicksToChange() {
+  return ( LightThreshTicks / (float) LIGHT_THRESH_TICKS_TO_CHANGE ) * 10;
+}


Tuned PID values

Tuned PID values

error: pathspec 'Ultrasonic' did not match any file(s) known to git
error: pathspec 'Wall' did not match any file(s) known to git
error: pathspec 'Follower/Wall_AvoidancePID_Maze_/Wall_AvoidancePID_Maze_.ino' did not match any file(s) known to git


Switch back to glider gun

Switch back to glider gun

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/JulianNicholls/Arduino.git/'


script to upload firmware. via this way I am able to load newest firmware (USB doen't work)

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/werar/iothome.git/'


fixed sound sensor folder

fixed sound sensor folder

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


Add Arduino code

Add Arduino code

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

--- Arduino/SillyFire/SillyFire.ino
+++ Arduino/SillyFire/SillyFire.ino
@@ -0,0 +1,27 @@
+#include <Servo.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
+
+void setup() {
+  Serial.begin(115200);
+  myservo.attach(11);  // attaches the servo on pin 11 to the servo object
+}
+
+void loop() {
+  if (Serial.available()){
+    char command = Serial.read();
+    //Reset position for the servo is 90
+    //down is up in value
+    if (command = "F"){
+      myservo.write(140);
+      delay(300);
+      myservo.write(90);
+    }
+  }
+  }
+
+
+


Add Arduino Code

Add Arduino Code

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

--- ArduinoButton/ArduinoButton.ino
+++ ArduinoButton/ArduinoButton.ino
@@ -0,0 +1,29 @@
+/**
+* Read the state of the button from the Digital In pin and
+* then switch off the LED when the button is pressed and communicate
+* the button state over the Serial interface
+*/
+
+#define LEDPIN 13
+#define INPIN 2
+
+int state = LOW;
+
+void setup() {
+  Serial.begin(9600); // setup serial connection speed
+  pinMode(LEDPIN, OUTPUT);
+  pinMode(INPIN, INPUT);
+}
+
+void loop() {
+  delay(10); // debounces switch
+  int sensorValue = digitalRead(INPIN);
+  if(state != sensorValue) {
+    state = sensorValue;
+    digitalWrite(LEDPIN, sensorValue); // turns the LED on or off
+
+    unsigned int state = sensorValue ;
+    Serial.print(state, BIN);
+    //Serial.println(sensorValue, DEC);
+  }
+}


TODO-632: test of tamper resistance

TODO-632: test of tamper resistance

Test that flipping any 1 bit in a secure enc/auth frame
is enough to prevent decode/decrypt/auth
unless all data remains intact (seqNum, id, body).

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/Denzo77/OTRadioLink.git/'


removed unnecessary objects

removed unnecessary objects

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


Simple Sketch to blink a LED

Simple Sketch to blink a LED

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

--- sketch_aug05a/sketch_aug05a.ino
+++ sketch_aug05a/sketch_aug05a.ino
@@ -0,0 +1,24 @@
+/*
+  Blink
+  Turns on an LED on for one second, then off for one second, repeatedly.
+
+  This example code is in the public domain.
+ */
+
+// Pin 13 has an LED connected on most Arduino boards.
+// give it a name:
+int led = 13;
+
+// the setup routine runs once when you press reset:
+void setup() {
+  // initialize the digital pin as an output.
+  pinMode(led, OUTPUT);
+}
+
+// the loop routine runs over and over again forever:
+void loop() {
+  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
+  delay(5000);               // wait for a second
+  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
+  delay(1000);               // wait for a second
+}


Sep22 code

Sep22 code

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

--- sketch_sep22a/sketch_sep22a.ino
+++ sketch_sep22a/sketch_sep22a.ino
@@ -0,0 +1,104 @@
+/* Phone dial input - By Koen van Vliet <8by8mail@gmail.com>
+ * Get input from a rotary dial found in old phones.
+ *
+ * Notes on rotary dial wireing:
+ *  The rest wire typically the red wire in dials from dutch PTT phones
+ *  The count pulse wire is typically the blue wire
+ *  The common (ground) wire is typically the yellow wire
+ *
+ *  Wire up the rest and pulse wire to I/O pins on the arduino (specified below)
+ *  Use 10k pullup resistors to 5V on both pins.
+ *
+ * Notes on light ring wireing:
+ *  Wire the positive lead of the LED to a resistor and the other end of the resistor to an I/O pin.
+ *  Next wire all negative leads of the LED's to ground. The I/O pins can be specified below.
+ */
+
+#define rest  2      /* Typically the red wire in dials from dutch PTT phones */
+#define pulse  3     /* Typically the blue wire */
+
+// Led light ring     0   1   2   3   4  5  6   7   8   9
+const uint8_t ring[] = { 13, A3, A2, A1, A0, 8, 9, 10, 11, 12 };
+
+void initRing()
+{
+  for( uint8_t i = 0; i < sizeof(ring); i++ )
+  {
+    pinMode(ring[i],OUTPUT);
+  }
+}
+
+void clearRing()
+{
+  for( uint8_t i = 0; i < sizeof(ring); i++ )
+  {
+    digitalWrite(ring[i], LOW);
+  }
+}
+
+void ledRing(uint8_t led)
+{
+  digitalWrite(ring[led], HIGH);
+}
+
+void setup()
+{
+  pinMode(rest, INPUT);
+  pinMode(pulse, INPUT);
+  Serial.begin(9600);
+  Serial.println("--Arduino telephone dial input--");
+  clearRing();
+}
+
+void loop()
+{
+  uint8_t counter;
+  boolean pulseactive;
+
+  Serial.println("Waiting for input...");
+  while( digitalRead(rest) == 1 ){}       // Do nothing while the dial sits idle
+  while( digitalRead(pulse) == 1 ){}      // Wait until the pulse-line is logic 0
+  delay(40);
+  Serial.println("Dial activity!");
+  clearRing();
+  counter = 0;
+  pulseactive = false;
+  while( digitalRead(rest) == 0 )       // Count pulses while dial rotates
+  {
+    if( pulseactive == false )
+    {
+      if( digitalRead(pulse) == 1 )
+      {
+        pulseactive = true;
+      }
+    }
+    else
+    {
+      if( digitalRead(pulse) == 0 )    // When pulse line goes from high to low a pulse is complete.
+      {
+        counter ++;                    // The counter increments every pulse
+        Serial.print("+");
+        pulseactive = false;
+        delay(70);
+      }
+    }
+  }
+  Serial.println( "END" );
+
+  if( counter == 0 || counter > 10 )
+  {
+    Serial.print("Dial invalid. Ignoring input ");
+    Serial.println( counter );
+  }
+  else
+  {
+    if( counter == 10 )
+    {
+        counter = 0;
+    }
+    Serial.print("Received number ");
+    Serial.print( counter );
+    ledRing(counter);
+    Serial.println("!");
+  }
+}


Added FancyMovement, some advanced robot movement functions.

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

--- FancyMovement/FancyMovement.ino
+++ FancyMovement/FancyMovement.ino
@@ -0,0 +1,161 @@
+#include <Adafruit_NeoPixel.h>
+
+/*** Pin Layout ***/
+
+// Motors //
+int standby = 6;
+
+int speedFL = 9; // front left speed
+int in1FL = 4;   // front left forward
+int in2FL = 2;   // front left backward
+
+int speedFR = 10; // front right speed
+int in1FR = 7;   // front right forward
+int in2FR = 8;   // front right backward
+
+int speedBL = 3; // back left speed
+int in1BL = A1;   // back left forward
+int in2BL = A0;   // back left backward
+
+int speedBR = 5; // back right speed
+int in1BR = A2;   // back right forward
+int in2BR = A3;   // back right backward
+
+// LEDs //
+int ledData = 12;
+Adafruit_NeoPixel strip = Adafruit_NeoPixel(2, ledData, NEO_RGB + NEO_KHZ800);
+
+
+void setup() {
+
+  /*** Pin Setup ***/
+  pinMode(standby, OUTPUT);
+
+  pinMode(speedFL, OUTPUT);
+  pinMode(in1FL, OUTPUT);
+  pinMode(in2FL, OUTPUT);
+
+  pinMode(speedFR, OUTPUT);
+  pinMode(in1FR, OUTPUT);
+  pinMode(in2FR, OUTPUT);
+
+  pinMode(speedBL, OUTPUT);
+  pinMode(in1BL, OUTPUT);
+  pinMode(in2BL, OUTPUT);
+
+  pinMode(speedBR, OUTPUT);
+  pinMode(in1BR, OUTPUT);
+  pinMode(in2BR, OUTPUT);
+
+  /** LED Setup **/
+  strip.begin();
+  strip.show();
+
+}
+
+void loop() {
+  strip.setPixelColor(0, strip.Color(255, 0, 0));
+  strip.setPixelColor(1, strip.Color(0, 255, 0));
+  strip.setPixelColor(2, strip.Color(0, 0, 255));
+  strip.show();
+  wake();
+
+  squiggle(100, 4000, 2);
+  delay(2000);
+
+  //allForward(100);
+  //delay(1000);
+  //brakes();
+  //allBackward(100);
+  //delay(1000);
+  //brakes();
+  //sleep();
+  //delay(1000);
+}
+
+void allForward(int forSpeed) {
+  motorize( 0, forSpeed, 1);
+  motorize( 1, forSpeed, 1);
+  motorize( 2, forSpeed, 1);
+  motorize( 3, forSpeed, 1);
+}
+
+void allBackward(int backSpeed) {
+  motorize( 0, backSpeed, 0);
+  motorize( 1, backSpeed, 0);
+  motorize( 2, backSpeed, 0);
+  motorize( 3, backSpeed, 0);
+}
+
+void brakes() {
+  motorize( 0, 0, 0);
+  motorize( 1, 0, 0);
+  motorize( 2, 0, 0);
+  motorize( 3, 0, 0);
+}
+
+void cwCircle(int circSpeed) {
+  motorize(0, circSpeed, 1);
+  motorize(1, circSpeed / 4, 1);
+  motorize(2, circSpeed, 1);
+  motorize(3, circSpeed / 4, 1);
+
+}
+
+void squiggle(int squigSpeed, int squigTime, int squigFactor) {
+  for (int i = 0; i < squigTime; i += 2000) {
+    motorize(0, squigSpeed, 1);
+    motorize(1, squigSpeed / squigFactor, 1);
+    motorize(2, squigSpeed, 1);
+    motorize(3, squigSpeed / squigFactor, 1);
+    delay(1000);
+    motorize(0, squigSpeed / squigFactor, 1);
+    motorize(1, squigSpeed, 1);
+    motorize(2, squigSpeed / squigFactor, 1);
+    motorize(3, squigSpeed, 1);
+    delay(1000);
+  }
+  brakes();
+}
+
+void motorize(int motor, int speed, int direction) {
+
+  // when direction is 0, default is backward
+  boolean forward = LOW;
+  boolean backward = HIGH;
+  // otherwise direction is 1 and is set to forward
+  if (direction == 1) {
+    forward = HIGH;
+    backward = LOW;
+  }
+
+  if (motor == 0) {
+    digitalWrite(in1FL, forward);
+    digitalWrite(in2FL, backward);
+    analogWrite(speedFL, speed);
+  }
+  else if (motor == 1) {
+    digitalWrite(in1FR, forward);
+    digitalWrite(in2FR, backward);
+    analogWrite(speedFR, speed);
+  }
+  else if (motor == 2) {
+    digitalWrite(in1BL, forward);
+    digitalWrite(in2BL, backward);
+    analogWrite(speedBL, speed);
+  }
+  else {
+    digitalWrite(in1BR, forward);
+    digitalWrite(in2BR, backward);
+    analogWrite(speedBR, speed);
+  }
+
+}
+
+void sleep() {
+  digitalWrite(standby, LOW); // enable standby mode
+}
+
+void wake() {
+  digitalWrite(standby, HIGH); // disable standby mode
+}


kgb's initial edit

kgb's initial edit

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/upperman/Wireless-Led-Display.git/'


Center servos

Center servos

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

--- servos_center/servos_center.ino
+++ servos_center/servos_center.ino
@@ -0,0 +1,65 @@
+// Center 8 servos
+
+#include <Servo.h>
+
+#define FLH_CENTER      1500
+#define FLF_CENTER      1500
+#define FRH_CENTER      1500
+#define FRF_CENTER      1500
+
+#define RLH_CENTER      1500
+#define RLF_CENTER      1500
+#define RRH_CENTER      1500
+#define RRF_CENTER      1500
+
+#define FLH_PIN 4    // Front Left Hip servo  pin
+#define FLF_PIN 5    // Front Left Foot servo  pin
+#define FRH_PIN 6    // Front Left Foot switch pin
+#define FRF_PIN 7    // Front Right Foot switch pin
+
+#define RLH_PIN 8    // Rear Left Hip switch pin
+#define RLF_PIN 9    // Rear Left Foot switch pin
+#define RRH_PIN 10   // Rear Right Foot switch pin
+#define RRF_PIN 11   // Rear Left Foot switch pin
+
+
+Servo servo_flh;
+Servo servo_flf;
+Servo servo_frh;
+Servo servo_frf;
+
+Servo servo_rlh;
+Servo servo_rlf;
+Servo servo_rrh;
+Servo servo_rrf;
+
+
+void setup()
+{
+  servo_flh.attach(FLH_PIN);
+  servo_flf.attach(FLF_PIN);
+  servo_frh.attach(FRH_PIN);
+  servo_frf.attach(FRF_PIN);
+
+  servo_rlh.attach(RLH_PIN);
+  servo_rlf.attach(RLF_PIN);
+  servo_rrh.attach(RRH_PIN);
+  servo_rrf.attach(RRF_PIN);
+
+  servo_flh.writeMicroseconds(FLH_CENTER);
+  servo_flf.writeMicroseconds(FLF_CENTER);
+  servo_frh.writeMicroseconds(FRH_CENTER);
+  servo_frf.writeMicroseconds(FRF_CENTER);
+
+  servo_rlh.writeMicroseconds(RLH_CENTER);
+  servo_rlf.writeMicroseconds(RLF_CENTER);
+  servo_rrh.writeMicroseconds(RRH_CENTER);
+  servo_rrf.writeMicroseconds(RRF_CENTER);
+}
+
+
+void loop()
+{
+
+}
+


Create sevenseg.ino

Create sevenseg.ino

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

--- firmware/examples/sevenseg/sevenseg.ino
+++ firmware/examples/sevenseg/sevenseg.ino
@@ -0,0 +1,87 @@
+/***************************************************
+  This is a library for our I2C LED Backpacks
+
+  Designed specifically to work with the Adafruit LED 7-Segment backpacks
+  ----> http://www.adafruit.com/products/881
+  ----> http://www.adafruit.com/products/880
+  ----> http://www.adafruit.com/products/879
+  ----> http://www.adafruit.com/products/878
+
+  These displays use I2C to communicate, 2 pins are required to
+  interface. There are multiple selectable I2C addresses. For backpacks
+  with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks
+  with 3 Address Select pins: 0x70 thru 0x77
+
+  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, all text above must be included in any redistribution
+ ****************************************************/
+
+// Enable one of these two #includes and comment out the other.
+// Conditional #include doesn't work due to Arduino IDE shenanigans.
+#include <Wire.h> // Enable this line if using Arduino Uno, Mega, etc.
+//#include <TinyWireM.h> // Enable this line if using Adafruit Trinket, Gemma, etc.
+
+#include "Adafruit_LEDBackpack.h"
+#include "Adafruit_GFX.h"
+
+Adafruit_7segment matrix = Adafruit_7segment();
+
+void setup() {
+#ifndef __AVR_ATtiny85__
+  Serial.begin(9600);
+  Serial.println("7 Segment Backpack Test");
+#endif
+  matrix.begin(0x70);
+}
+
+void loop() {
+  // try to print a number thats too long
+  matrix.print(10000, DEC);
+  matrix.writeDisplay();
+  delay(500);
+
+  // print a hex number
+  matrix.print(0xBEEF, HEX);
+  matrix.writeDisplay();
+  delay(500);
+
+  // print a floating point
+  /* this isnt working yet, still hacking on it!
+  matrix.print(12.34);
+  matrix.writeDisplay();
+  delay(500);
+  */
+
+  // print with print/println
+  for (uint16_t counter = 0; counter < 9999; counter++) {
+    matrix.println(counter);
+    matrix.writeDisplay();
+    delay(10);
+  }
+
+  // method #2 - draw each digit
+  uint16_t blinkcounter = 0;
+  boolean drawDots = false;
+  for (uint16_t counter = 0; counter < 9999; counter ++) {
+    matrix.writeDigitNum(0, (counter / 1000), drawDots);
+    matrix.writeDigitNum(1, (counter / 100) % 10, drawDots);
+    matrix.drawColon(drawDots);
+    matrix.writeDigitNum(3, (counter / 10) % 10, drawDots);
+    matrix.writeDigitNum(4, counter % 10, drawDots);
+
+    blinkcounter+=50;
+    if (blinkcounter < 500) {
+      drawDots = false;
+    } else if (blinkcounter < 1000) {
+      drawDots = true;
+    } else {
+      blinkcounter = 0;
+    }
+    matrix.writeDisplay();
+    delay(10);
+  }
+}


Règle d'Optimisation : Prototyper avant de fignoler. Mettre au point avant d'optimiser. [Eric S. Raymond - The Art of Unix Programming] Note à moi-même : It works !

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/jordane-quincy/projet_m1.git/'


add example for ssl websocket with CA certificate

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


Adds the basic sketch

Adds the basic sketch

This is just the base sketch as generated by ino init, nothing specal
has been done to it other then giving it a more appropiate name

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

--- src/drifter.ino
+++ src/drifter.ino
@@ -0,0 +1,8 @@
+
+void setup()
+{
+}
+
+void loop()
+{
+}


Added sketch

Added sketch

--- EmbedVM_Arduino.ino
+++ EmbedVM_Arduino.ino
@@ -0,0 +1,103 @@
+#include <EEPROM.h>
+
+#include <embedvm.h>
+
+#define UNUSED __attribute__((unused))
+
+#define MEM_SIZE 1*1024 //bytes of RAM allocated to the VM
+#define PROG_LENGTH 128 //bytes of instruction read by the VM
+#define PROG_OFFSET 0 //address of program in EEPROM
+#define PROG_START 0 //address of first instruction (relative to PROG_OFFSET
+#define BAUDRATE 9600 //UART baudrate
+#define VERBOSE false //verbose mode
+
+boolean stop = false;
+byte memory[MEM_SIZE];
+
+//put in seperate namespace to prevent Arduino IDE from preprocessing it; Arduino preprocessor is ST00PID
+namespace no {
+  struct embedvm_s vm = {
+    0xffff, 0, 0, NULL,
+    &mem_read, &mem_write, &call_user
+  };
+}
+
+void setup()
+{
+  Serial.begin(BAUDRATE);
+  for(int addr = 0; addr < PROG_LENGTH; addr++)
+    memory[addr] = EEPROM.read(addr + PROG_OFFSET);
+  embedvm_interrupt(&no::vm, PROG_START);
+}
+
+void loop()
+{
+  if (stop) return; //skip if stopped
+
+  //terminate if main function returns
+  if (no::vm.ip = 0xFFFF)
+  {
+    Serial.println("Main function returned => Terminating.");
+    if (no::vm.sp != 0 || no::vm.sfp != 0)
+      Serial.println("Unexpected stack configuration on program exit: SP=" + String(no::vm.sp) + ", SFP=" + String(no::vm.sfp));
+    Serial.flush();
+    stop = true;
+  }
+
+  //verbose
+  if (VERBOSE)
+  {
+    Serial.print("IP: " + String(no::vm.ip) + " (" + String(memory[no::vm.ip]) + " " + String(memory[no::vm.ip + 1]) + " " + String(memory[no::vm.ip + 2]) + " " + String(memory[no::vm.ip + 3]) + "),  "); //print next instruction to execute
+    Serial.print("SP: " + String(no::vm.sp) + " (" + String(memory[no::vm.sp]) + String(memory[no::vm.sp + 1]) + " " + String(memory[no::vm.sp + 2]) + String(memory[no::vm.sp + 3]) + " " + String(memory[no::vm.sp + 4]) + String(memory[no::vm.sp + 5]) + " " + String(memory[no::vm.sp + 6]) + String(memory[no::vm.sp + 7]) + "),  "); //print last pushed words on the stack
+    Serial.print("SFP: " + String(no::vm.sfp)); //print the address of the first local variable on the stack
+    Serial.println("");
+    Serial.flush();
+  }
+
+  embedvm_exec(&no::vm); //execute next instruction
+}
+
+
+static int16_t mem_read(uint16_t addr, bool is16bit, void *ctx UNUSED)
+{
+  if (is16bit)
+    return (memory[addr] << 8) | memory[addr+1];
+  return memory[addr];
+}
+
+static void mem_write(uint16_t addr, int16_t value, bool is16bit, void *ctx UNUSED)
+{
+  if (is16bit) {
+    memory[addr] = value >> 8;
+    memory[addr+1] = value;
+  }
+  else
+    memory[addr] = value;
+}
+
+static int16_t call_user(uint8_t funcid, uint8_t argc, int16_t *argv, void *ctx UNUSED)
+{
+  int16_t ret = 0;
+  int i;
+
+  if (funcid == 0) {
+    stop = true;
+    Serial.println("Called user function 0 => stop.");
+    Serial.flush();
+    return ret;
+  }
+
+  Serial.print("Called user function " + String(funcid) + " with " + String(argc) + " args:");
+
+  for (i = 0; i < argc; i++) {
+    Serial.print(" " + argv[i]);
+    ret += argv[i];
+  }
+
+  Serial.println("");
+  Serial.flush();
+
+  return ret ^ funcid;
+}
+
+


isChange

isChange

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

--- sketch_dec03b.ino
+++ sketch_dec03b.ino
@@ -0,0 +1,40 @@
+const int M11 = 30;
+const int M12 = 31;
+const int M21 = 32;
+const int M22 = 33;
+const int M31 = 34;
+const int M32 = 35;
+const int M41 = 36;
+const int M42 = 37;
+
+int pin[8] = {30, 31, 32, 33, 34, 35, 36, 37};
+int laststate[8] = {1};
+
+void setup() {
+  // put your setup code here, to run once:
+  pinMode(M11, INPUT);
+  pinMode(M12, INPUT);
+  pinMode(M21, INPUT);
+  pinMode(M31, INPUT);
+  pinMode(M32, INPUT);
+  pinMode(M41, INPUT);
+  pinMode(M42, INPUT);
+
+  Serial.begin(115200);
+}
+
+void loop() {
+  // put your main code here, to run repeatedly:
+  int i;
+  for (i = 0; i < 8; i++) {
+    if ( digitalRead(pin[i]) != laststate[i] && laststate[i] == 1 ) {
+      Serial.print("the state");
+      Serial.print(i);
+      Serial.print(" is ");
+      Serial.println(digitalRead(pin[i]));
+      laststate[i] = digitalRead(pin[i]);
+    }
+    else if ( digitalRead(pin[i]) != laststate[i] && laststate[i] == 0 )
+      laststate[i] = digitalRead(pin[i]);
+  }
+}


Initial Commit.  Still implementing the PID algorithm

--- Temperature_Read_Test.ino
+++ Temperature_Read_Test.ino
@@ -0,0 +1,266 @@
+
+
+/***************************************************
+  This is an example for the Adafruit Thermocouple Sensor w/MAX31855K
+
+  Designed specifically to work with the Adafruit Thermocouple Sensor
+  ----> https://www.adafruit.com/products/269
+
+  These displays use SPI to communicate, 3 pins are required to
+  interface
+  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, all text above must be included in any redistribution
+ ****************************************************/
+
+#include <SPI.h>
+#include "Adafruit_MAX31855.h"
+#include <Bridge.h>
+#include <Console.h>
+#include <PID_AutoTune_v0.h>
+#include <PID_v1.h>
+
+// So we can save and retrieve settings
+#include <EEPROM.h>
+
+// IO Pins for thermocouple
+#define DO   3
+#define CS   4
+#define CLK  5
+//Keys for the Bridge interface
+#define DEGF "degF"
+#define DEGC "degC"
+#define TARGEF "targetF"
+
+#define KP "kp"
+#define SP "sp"
+#define KI "ki"
+#define KD "kd"
+// Output Relay
+#define RelayPin 7
+
+// ************************************************
+// PID Variables and constants
+// ************************************************
+
+//Define Variables we'll be connecting to
+double Setpoint;
+double Input;
+double Output;
+
+volatile long onTime = 0;
+
+// pid tuning parameters
+double Kp;
+double Ki;
+double Kd;
+
+// EEPROM addresses for persisted data
+const int SpAddress = 0;
+const int KpAddress = 8;
+const int KiAddress = 16;
+const int KdAddress = 24;
+
+Adafruit_MAX31855 thermocouple(CLK, CS, DO);
+//Specify the links and initial tuning parameters
+PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);
+
+// 10 second Time Proportional Output window
+int WindowSize = 10000;
+unsigned long windowStartTime;
+
+// ************************************************
+// Auto Tune Variables and constants
+// ************************************************
+byte ATuneModeRemember=2;
+
+double aTuneStep=500;
+double aTuneNoise=1;
+unsigned int aTuneLookBack=20;
+
+boolean tuning = false;
+
+PID_ATune aTune(&Input, &Output);
+
+const int logInterval = 10000; // log every 10 seconds
+long lastLogTime = 0;
+
+// ************************************************
+// States for state machine
+// ************************************************
+enum operatingState { OFF = 0, SETP, RUN, TUNE_P, TUNE_I, TUNE_D, AUTO};
+operatingState opState = OFF;
+
+String setTemp = "";
+
+void setup() {
+  Bridge.begin();
+  Console.begin();
+  // Initialize Relay Control:
+  pinMode(RelayPin, OUTPUT);    // Output mode to drive relay
+  digitalWrite(RelayPin, LOW);  // make sure it is off to start
+
+  // Initialize the PID and related variables
+  LoadParameters();
+
+  // wait for MAX chip to stabilize
+  delay(500);
+  //Timer code, not sure if need
+  // Run timer2 interrupt every 15 ms
+  //TCCR4A = 0;
+  //TCCR4B = 1<<CS42 | 1<<CS41 | 1<<CS40;
+
+  //Timer2 Overflow Interrupt Enable
+  //TIMSK4 |= 1<<TOIE4;
+}
+
+// ************************************************
+// Timer Interrupt Handler
+//MIGHT NEED TO DO WORK HERE, MIGHT NEED DIFFERENT TIMER
+// ************************************************
+/*SIGNAL(TIMER1_OVF_vect)
+{
+  if (opState == OFF)
+  {
+    digitalWrite(RelayPin, LOW);  // make sure relay is off
+  }
+  else
+  {
+    //DriveOutput();
+  }
+}*/
+
+void loop() {
+  char tempSetBuf[4];
+   if (Bridge.get("setTemp", tempSetBuf, 4) > 0) {
+     setTemp = String(tempSetBuf);
+     //Console.println(setTemp);
+     //Bridge.put("targetF=", setTemp);
+   }
+
+   double c = thermocouple.readCelsius();
+   if (isnan(c)) {
+     //Console.println("Something wrong with thermocouple!");
+   } else {
+
+     //We're getting good data.  Make is so the bridge can see it
+     double tempF = thermocouple.readFarenheit();
+     if (!setTemp.equals("")) {
+       Bridge.put(TARGEF, setTemp);
+     }
+     Bridge.put(DEGF, doubleToString(tempF, 2));
+
+   }
+   delay(1000);
+
+}
+
+void Off() {
+  myPID.SetMode(MANUAL);
+  digitalWrite(RelayPin, LOW);
+}
+
+// ************************************************
+// Save any parameter changes to EEPROM
+// ************************************************
+void SaveParameters()
+{
+   if (Setpoint != EEPROM_readDouble(SpAddress))
+   {
+      EEPROM_writeDouble(SpAddress, Setpoint);
+   }
+   if (Kp != EEPROM_readDouble(KpAddress))
+   {
+      EEPROM_writeDouble(KpAddress, Kp);
+   }
+   if (Ki != EEPROM_readDouble(KiAddress))
+   {
+      EEPROM_writeDouble(KiAddress, Ki);
+   }
+   if (Kd != EEPROM_readDouble(KdAddress))
+   {
+      EEPROM_writeDouble(KdAddress, Kd);
+   }
+}
+
+// ************************************************
+// Load parameters from EEPROM
+// ************************************************
+void LoadParameters()
+{
+  // Load from EEPROM
+   Setpoint = EEPROM_readDouble(SpAddress);
+   Kp = EEPROM_readDouble(KpAddress);
+   Ki = EEPROM_readDouble(KiAddress);
+   Kd = EEPROM_readDouble(KdAddress);
+
+   // Use defaults if EEPROM values are invalid
+   if (isnan(Setpoint))
+   {
+     Setpoint = 60;
+   }
+   if (isnan(Kp))
+   {
+     Kp = 500;
+   }
+   if (isnan(Ki))
+   {
+     Ki = 0.5;
+   }
+   if (isnan(Kd))
+   {
+     Kd = 0.1;
+   }
+}
+
+
+// ************************************************
+// Write floating point values to EEPROM
+// ************************************************
+void EEPROM_writeDouble(int address, double value)
+{
+   byte* p = (byte*)(void*)&value;
+   for (int i = 0; i < sizeof(value); i++)
+   {
+      EEPROM.write(address++, *p++);
+   }
+}
+
+// ************************************************
+// Read floating point values from EEPROM
+// ************************************************
+double EEPROM_readDouble(int address)
+{
+   double value = 0.0;
+   byte* p = (byte*)(void*)&value;
+   for (int i = 0; i < sizeof(value); i++)
+   {
+      *p++ = EEPROM.read(address++);
+   }
+   return value;
+}
+
+//Helpers for String to double conversions
+String doubleToString(double input,int decimalPlaces){
+  if(decimalPlaces!=0){
+    String string = String((int)(input*pow(10,decimalPlaces)));
+    if(abs(input)<1){
+      if(input>0)
+        string = "0"+string;
+      else if(input<0)
+        string = string.substring(0,1)+"0"+string.substring(1);
+    }
+    return string.substring(0,string.length()-decimalPlaces)+"."+string.substring(string.length()-decimalPlaces);
+    } else {
+      return String((int)input);
+  }
+}
+
+double stringToDouble(String input) {
+    char floatbuf[8];
+    input.toCharArray(floatbuf, sizeof(floatbuf));
+    return atof(floatbuf);
+}


Adding Serial passthrough example.

Adding Serial passthrough example.

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

--- examples/ESP8266_Serial_Passthrough/ESP8266_Serial_Passthrough.ino
+++ examples/ESP8266_Serial_Passthrough/ESP8266_Serial_Passthrough.ino
@@ -0,0 +1,53 @@
+/************************************************************
+ESP8266_Serial_Passthrough.h
+SparkFun ESP8266 AT library - Serial Passthrough Utility
+Jim Lindblom @ SparkFun Electronics
+Original Creation Date: July 16, 2015
+https://github.com/sparkfun/SparkFun_ESP8266_AT_Arduino_Library
+
+This example sketch is a handy "serial passthrough". Anything
+sent to the Arduino serial port will be routed to the ESP8266
+software serial port, and vice-versa.
+
+If you use the Serial Monitor, make sure you SET THE LINE
+ENDING PULLDOWN to "Both NL & CR".
+
+Then try typing commands from the AT command set
+(https://cdn.sparkfun.com/assets/learn_tutorials/4/0/3/4A-ESP8266__AT_Instruction_Set__EN_v0.30.pdf)
+
+For example, to set the mode to STA, connect to a network,
+and check your IP address, type:
+AT+CWMODE=1
+AT+CWJAP="networkName","networkPassword"
+AT+CIFSR
+
+Development environment specifics:
+  IDE: Arduino 1.6.5
+  Hardware Platform: Arduino Uno
+  ESP8266 WiFi Shield Version: 1.0
+
+This code is released under the MIT license.
+
+Distributed as-is; no warranty is given.
+************************************************************/
+#include <SoftwareSerial.h>
+#include <SparkFunESP8266WiFi.h>
+
+void setup()
+{
+  Serial.begin(9600);
+  esp8266.begin();
+}
+
+void loop()
+{
+  serialPassthrough();
+}
+
+void serialPassthrough()
+{
+  while (Serial.available())
+    esp8266.write(Serial.read());
+  while (esp8266.available())
+    Serial.write(esp8266.read());
+}