CMD library added for serial comunication.

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


unmoved motors have a poscomp=0

unmoved motors have a poscomp=0

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


Create test.ino

Create test.ino

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


Example for an application that switches between PRX and PTX as needed

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

--- examples/advanced_sensor/advanced_sensor.ino
+++ examples/advanced_sensor/advanced_sensor.ino
@@ -0,0 +1,126 @@
+#include <SPI.h>
+#include <NRF24.h>
+
+NRF24 radio;
+
+// If we have one sensor and multiple listeners
+#define USE_BROADCAST
+
+bool host;
+
+uint16_t sensorDelay = 0;
+unsigned long previousTransmission = 0;
+
+void setup()
+{
+	Serial.begin(115200);
+	Serial.println(F("NRF24 Mixed example"));
+
+	radio.begin(9, 10);
+
+	// Pin 7 sets the mode (Sender or Receiver). Connect to GND on the sender
+	pinMode(7, INPUT_PULLUP);
+	host = !digitalRead(7);
+
+	if (host)
+	{
+		// host
+#ifndef USE_BROADCAST
+		// this could be enabled for broadcast too, just showing that it doesn't have to be
+		// when broadcasting the client doesn't care what the address of the receiver(s) is
+		radio.setAddress(0xEE);
+#endif
+		radio.listenToAddress(0xDD);
+	}
+	else
+	{
+		// sensor
+		radio.setAddress(0xDD);
+		radio.startListening();
+	}
+
+	Serial.print(F("Mode: "));
+	Serial.println(host ? F("host") : F("sensor"));
+
+	if (host)
+	{
+		Serial.println(F("Set transmission interval by using 0-9"));
+	}
+}
+
+void loop()
+{
+	if (sensorDelay > 0 && millis() > previousTransmission + sensorDelay)
+	{
+		uint16_t v = analogRead(0);
+
+		uint8_t buf[2];
+		buf[0] = (v >> 8) & 0xFF;
+		buf[1] = v & 0xFF;
+
+		Serial.print(F("Sending sample "));
+		Serial.println(v);
+
+#ifdef USE_BROADCAST
+		// the problem with this is that there's no confirmation they reached their target
+		radio.broadcast(buf, sizeof(buf));
+#else
+		radio.send(0xEE, buf, sizeof(buf));
+#endif
+
+		previousTransmission = millis();
+	}
+
+	if (radio.available())
+	{
+		uint8_t buf[2];
+		radio.read(buf, sizeof(buf));
+
+		if (host)
+		{
+			// extract 16 bit value
+			uint16_t v = ((uint16_t)buf[0] << 8) | (uint16_t)buf[1];
+			Serial.print(F("Received: "));
+			Serial.println(v);
+		}
+		else
+		{
+			// received command from host
+			sensorDelay = buf[0] * 100;
+
+			Serial.print(F("New delay: "));
+			Serial.print(sensorDelay);
+			Serial.println(F("ms"));
+
+			// allow host to transition to listener
+			delay(1);
+		}
+	}
+
+	if (host && Serial.available())
+	{
+		char c = Serial.read();
+		if (host)
+		{
+			if (c >= '0' && c <= '9')
+			{
+				uint8_t numSamples = c - '0';
+
+				if (numSamples > 0)
+				{
+					Serial.print(F("Setting sample delay "));
+					Serial.print(numSamples * 100);
+					Serial.println(F("ms"));
+				}
+				else
+				{
+					Serial.println(F("Turning off sensor"));
+				}
+
+				uint8_t buf[1] = {numSamples};
+				bool sent = radio.send(0xDD, buf, sizeof(buf));
+				if (!sent) Serial.println(F("Request failed"));
+			}
+		}
+	}
+}


and some more little changes

and some more little changes

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/TEAMarg/SiNe-DeMo.git/'


we explicitly set the spi clock div

we explicitly set the spi clock div

just to have it fixed - and to be able to change it later?!


Add draw text with scale example.

Add draw text with scale example.

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

--- AL_ILI9341/examples/DrawTextWithScale/DrawTextWithScale.ino
+++ AL_ILI9341/examples/DrawTextWithScale/DrawTextWithScale.ino
@@ -0,0 +1,40 @@
+#include "AL_ILI9341.h"
+#include "AL_Font.h"
+
+// Wiring
+#define TFT_PORT PORTF
+#define TFT_PIN PINF
+#define TFT_DDR DDRF
+#define TFT_RST A12
+#define TFT_CS A11
+#define TFT_RS A10
+#define TFT_WR A9
+#define TFT_RD A8
+
+AL_ILI9341 tft(
+    &TFT_PORT, &TFT_PIN, &TFT_DDR,
+    TFT_RST, TFT_CS, TFT_RS, TFT_WR, TFT_RD);
+
+AL_RgbColor backColor{255, 255, 255};
+AL_RgbColor text1Color{255, 0, 0};
+AL_RgbColor text2Color{0, 255, 0};
+AL_RgbColor text3Color{0, 0, 255};
+AL_RgbColor text4Color{0, 255, 255};
+AL_RgbColor text5Color{255, 255, 0};
+
+void setup()
+{
+    tft.setup();
+    tft.setOrientation(AL_SO_LANDSCAPE2);
+    tft.fillRect(0, 0, tft.getWidth(), tft.getHeight(), backColor);
+
+    tft.drawText(10, 10, text1Color, backColor, 1, "hello");
+    tft.drawText(10, 26, text2Color, backColor, 2, "hello");
+    tft.drawText(10, 58, text3Color, backColor, 3, "hello");
+    tft.drawText(10, 106, text4Color, backColor, 4, "hello");
+    tft.drawText(10, 170, text5Color, backColor, 5, "hello");
+}
+
+void loop()
+{
+}


Example of controlling Sainsmart LCD2004 over I2C interface

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

--- uno/LCD2004/LCD2004.ino
+++ uno/LCD2004/LCD2004.ino
@@ -0,0 +1,30 @@
+// Example of using SainSmart IIC/I2C/TWI Serial 2004 20x4 LCD Module
+// For the Arduino
+// UNO: SDA - A4, SCL - A5.
+// Leonardo: SDA - D2, SCL - D3
+// Mega 2560: SDA - 20, SCL - 21
+// DUE: SDA - 20, SCL - 21 over 3.3 <-> 5V level converter
+
+
+// LCD Library: https://arduino-info.wikispaces.com/file/detail/LiquidCrystal_I2C2004V1.zip
+
+#include <Wire.h>
+#include <LiquidCrystal_I2C.h>
+
+//Addr: 0x3F, 20 chars & 4 lines
+LiquidCrystal_I2C lcd(0x3F,20,4);
+
+void setup()
+{
+    lcd.init();
+    lcd.backlight();
+    lcd.setCursor(0, 0);
+    lcd.print("Hello");
+    lcd.setCursor(0, 1);
+    lcd.print("World!");
+
+}
+void loop()
+{
+
+}


Add Radio initialisation to S-r-u

Add Radio initialisation to S-r-u

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


Create termometer.ino

Create termometer.ino

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

--- termometer/termometer.ino
+++ termometer/termometer.ino
@@ -0,0 +1,66 @@
+#include "DHT.h"
+
+DHT dht;
+#define redLed 11
+#define yellowLed 10
+#define orangeLed 9
+#define greenLed 8
+
+void setup()
+{
+  Serial.begin(9600);
+  Serial.println();
+  Serial.println("Status\tHumidity (%)\tTemperature (C)");
+
+  dht.setup(2); // data pin 2
+
+  pinMode(redLed, OUTPUT);
+  pinMode(yellowLed, OUTPUT);
+  pinMode(orangeLed, OUTPUT);
+  pinMode(greenLed, OUTPUT);
+}
+
+void loop()
+{
+  delay(dht.getMinimumSamplingPeriod());
+
+  float humidity = dht.getHumidity();
+  float temperature = dht.getTemperature();
+
+  Serial.print(dht.getStatusString());
+  Serial.print("\t");
+  Serial.print(humidity, 1);
+  Serial.print("\t\t");
+  Serial.print(temperature, 1);
+  Serial.print('\n');
+
+  if(temperature <= 24){
+    digitalWrite(redLed, LOW);
+    digitalWrite(yellowLed, LOW);
+    digitalWrite(orangeLed, LOW);
+    digitalWrite(greenLed, HIGH);
+  }
+
+  if(temperature > 24 && temperature <= 26){
+    digitalWrite(redLed, LOW);
+    digitalWrite(yellowLed, LOW);
+    digitalWrite(orangeLed, HIGH);
+    digitalWrite(greenLed, LOW);
+  }
+
+  if(temperature > 26 && temperature <= 28){
+    digitalWrite(redLed, LOW);
+    digitalWrite(yellowLed, HIGH);
+    digitalWrite(orangeLed, LOW);
+    digitalWrite(greenLed, LOW);
+  }
+
+  if(temperature > 28){
+    digitalWrite(redLed, HIGH);
+    digitalWrite(yellowLed, LOW);
+    digitalWrite(orangeLed, LOW);
+    digitalWrite(greenLed, LOW);
+  }
+
+}
+


Control a BlinkM on a specific Jeenode port.

Control a BlinkM using BlinkM commands. This version implements the
commands needed for the initial art project with the remaining commands
left unimplmented. It needs a major refactoring which is also left as a
future project.

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

--- sketches/utils/blinkm_control/blinkm_control.ino
+++ sketches/utils/blinkm_control/blinkm_control.ino
@@ -0,0 +1,537 @@
+/*
+ * Control a BlinkM on a specific Jeenode port using BlinkM commands.
+ * See the comments at the top of the i2c_scan sketch for pin
+ * assignments. This only works for the first device on the bus.
+ *
+ * Notes:
+ * 1. Set the Jeenode port number running the I2C bus that has the
+ *    BlinkM on it.
+ * 2. Set the BlinkM to be powered externally.
+ *
+ * This sketch motivated by, and parts taken from, todbot's BlinkMTester
+ * sketch. The current version is at
+ * github.com/todbot/BlinkM-Arduino/BlinkM/examples/BlinkMTester
+ * although an earlier version was used in this sketch.
+ *
+ * A major refactoring would be useful but postponed until there
+ * is more time.
+ *
+ * @author Bill <bill@jamimi.com>
+ * @license http://opensource.org/licenses/mit-license.php
+ */
+
+#include <JeeLib.h>
+
+// Jeenode port to scan
+const byte portNum = 2;
+
+// The I2C bus and device objects
+PortI2C i2cBus (portNum);
+// Device address is set during scan
+DeviceI2C dev (i2cBus, 0);
+
+// Blink an LED on Jeenode port 3 to show the sketch is active
+Port led (3);
+
+const byte loDevId = 1;
+const byte hiDevId = 127;
+byte foundDevId = 0;
+char cmd = '\0';
+
+// Variables for reading input
+// The input string
+char inputData[20];
+// The just-read input character
+char inputChar = -1;
+// Index of where to store the next character
+byte index = 0;
+
+byte addr = 0;
+
+// Various named parameters used below
+//TODO there must be a better way...
+int scriptNum = 0;
+int numRepeats = 0;
+int startLine = 0;
+int scriptMode = 0;
+int fadeSpeed = 0;
+int timeAdj = 0;
+byte cRed = 0;
+byte cGreen = 0;
+byte cBlue = 0;
+
+/*
+const char helpstr[] PROGMEM =
+  "\nBlinkMTester!\n"
+  "'c<rrggbb>'  fade to an rgb color\n"
+  "'h<hhssbb>'  fade to an hsb color\n"
+  "'C<rrggbb>'  fade to a random rgb color\n"
+  "'H<hhssbb>'  fade to a random hsb color\n"
+  "'p<n>'  play a script\n"
+  "'o'  stop a script\n"
+  "'f<nn>'  change fade speed\n"
+  "'t<nn>'  set time adj\n"
+  "'g'  get current color\n"
+  "'a'  get I2C address\n"
+  "'A<n>'  set I2C address\n"
+  "'B'  set startup params to default\n"
+  "'Z'  get BlinkM version\n"
+  "'i'  get input values\n"
+  "'s'/'S'  scan i2c bus for 1st BlinkM / search for devices\n"
+  "'R'  return BlinkM to factory settings\n"
+  "'?'  for this help msg\n\n"
+  ;
+void printProgStr(const prog_char str[])
+{
+  char c;
+  if(!str) return;
+  while((c = pgm_read_byte(str++)))
+    Serial.write(c);
+}
+
+void help()
+{
+  printProgStr( helpstr );
+}
+*/
+
+void setup () {
+  Serial.begin(57600);
+  Serial.print("\nScan I2C bus on port ");
+  Serial.println(portNum);
+
+  led.mode(OUTPUT);
+
+  Serial.print("Trying ID ");
+
+  // Scan for devices and stop at first one
+  for (byte devid = loDevId; devid <= hiDevId; devid++) {
+    Serial.print(devid, DEC);
+    Serial.print("...");
+    if (!devid % 20) Serial.println();
+    dev.setAddress(devid);
+    if (!dev.isPresent()) continue;
+    foundDevId = devid;
+    break;
+  }
+
+  Serial.println();
+  if (foundDevId == 0) {
+    Serial.println("No device found");
+  } else {
+    Serial.print("Found device at ID ");
+    Serial.println(foundDevId);
+  }
+
+  Serial.print("Enter command: ");
+}
+
+void loop () {
+  // Build command string
+  while (Serial.available() > 0) {
+    if (index < 19) {
+      inputChar = Serial.read();
+      inputData[index] = inputChar;
+      index++;
+      inputData[index] = '\0';
+    } else {
+      inputData[index] = '\0';
+      char ignore = Serial.read();
+    }
+  }
+
+  // Process command
+  if (inputData[0] != '\0') {
+    // Echo the entered command
+    Serial.println(inputData);
+
+    // The first character is the command
+    cmd = inputData[0];
+    int val = 0;
+    int parms[5];
+    byte parmIdx = 0;
+
+    // Set parms to -1 for "not set"
+    for (byte i = 0; i <= 4; i++) {
+      parms[i] = -1;
+    }
+
+    // 0 if val is null, 1 if has value
+    byte valSet = 0;
+
+    // Parse the rest of the string which is decimal numbers
+    // separated by commas
+    // TODO need to process leading "-"
+    for (byte i = 1; i <= 19; i++) {
+      // Done if no more characters
+      if (inputData[i] == '\0') break;
+      // Process parm
+      // Commas delimit parms
+      if (inputData[i] == ',') {
+        if (parmIdx > 4) break;
+        parms[parmIdx] = val;
+        parmIdx++;
+        val = 0;
+        valSet = 0;
+        continue;
+      }
+      // Skip blanks
+      if (inputData[i] == ' ') continue;
+
+      // Stop processing if non-digit
+      if ((inputData[i] < '0') || (inputData[i] > '9')) break;
+      valSet = 1;
+      val = (val * 10) + (inputData[i] - 48);
+    }   // end for
+
+    // Get any last parm
+    if ((parmIdx <= 4) && (valSet ==1 )) {
+      parms[parmIdx] = val;
+      parmIdx++;
+    }
+
+    /*
+    Serial.print("Parms: ");
+    for (byte j = 0; j <= parmIdx - 1; j++) {
+      Serial.print(j);
+      Serial.print('=');
+      if (parms[j] == -1) {
+        Serial.println("Not set");
+        break;
+      }
+      Serial.print(parms[j], DEC);
+      Serial.print(", ");
+    }
+    Serial.println("done");
+    */
+
+    switch (cmd) {
+
+      // Print help
+      case '?':
+        Serial.println("Help is not implemented");
+        break;
+
+      // Set new device id
+      case 'A':
+        // new device id in parm[0]
+        if ((parms[0] < 1) || (parms[0] > 127)) {
+          Serial.println("Address is out of range; ignoring");
+        } else {
+          addr = byte(parms[0]);
+          Serial.print("Setting new address to ");
+          Serial.print(addr, DEC);
+          Serial.print(" (");
+          Serial.print(addr, HEX);
+          Serial.println(") hex");
+
+          dev.send();
+          dev.write('A');
+          dev.write(addr);
+          dev.write(0xd0);
+          dev.write(0x0d);
+          dev.write(addr);
+          dev.stop();
+          dev.setAddress(addr);
+          delay(15);        // Datasheet says controller needs 15ms
+        }
+        break;
+
+      // Get the current device address
+      case 'a':
+        dev.send();
+        dev.write('a');
+        dev.stop();
+        dev.receive();
+        addr = dev.read(1);
+        dev.stop();
+        Serial.println("Get the current device address");
+        Serial.println(addr);
+        break;
+
+      // Set the startup action
+      // 5 parameters: play script or not, scriptnum, repeats, fade, time
+      case 'B':
+        scriptMode = parms[0];
+        scriptNum = parms[1];
+        numRepeats = parms[2];
+        fadeSpeed = parms[3];
+        // TODO need to handle negative numbers
+        timeAdj = parms[4];
+
+        if ((scriptMode != 0) && (scriptMode !=1)) {
+          Serial.println("Script start mode is out of range; setting to 1 (play a script)");
+          scriptMode = 1;
+        }
+        if ((scriptNum < 0) || (scriptNum > 18)) {
+          Serial.println("Light script id is out of range; setting to script 0");
+          scriptNum = 0;
+        }
+        if (numRepeats < 0) {
+          Serial.println("Number of repeats not set; setting to 0 (run forever)");
+          numRepeats = 0;
+        }
+        if ((fadeSpeed < 1) || (fadeSpeed > 255)) {
+          Serial.println("Fade speed out of range; setting to 128");
+          fadeSpeed = 128;
+        }
+        if ((timeAdj < -128) || (timeAdj > 127)) {
+          Serial.println("Time adjustment is out of range; setting to 0 (default)");
+          timeAdj = 0;
+        }
+
+        Serial.print("Set startup parameters to ");
+        if (scriptMode == 1) {
+          Serial.print("play a script, ");
+        } else {
+          Serial.print("do nothing, ");
+        }
+        Serial.print("script id ");
+        Serial.print(scriptNum);
+        Serial.print(" with ");
+        Serial.print(numRepeats);
+        Serial.print(" repeats, fade speed ");
+        Serial.print(fadeSpeed);
+        Serial.print(", time adjustment ");
+        Serial.println(timeAdj);
+
+        dev.send();
+        dev.write('B');   // Set startup parameters
+        dev.write(scriptMode);
+        dev.write(scriptNum);
+        dev.write(numRepeats);
+        dev.write(fadeSpeed);
+        dev.write(timeAdj);
+        dev.stop();
+        delay(50);        // Data sheet says controller needs 20ms
+        break;
+
+      // Fade to HSB color
+      // 3 parameters: R, G, B values
+      //TODO implement
+      case 'h':
+        Serial.println("Fade to HSB color is not implemented");
+        break;
+
+      // Fade to random HSB color
+      // 3 parameters: R, G, B values
+      //TODO implement
+      case 'H':
+        Serial.println("Fade to random HSB color is not implemented");
+        break;
+
+
+      // Fade to RGB color
+      // 3 parameters: R, G, B values
+      //TODO implement
+      case 'c':
+        Serial.println("Fade to RGB color is not implemented");
+        break;
+
+      // Fade to random RGB color
+      // 3 parameters: R, G, B values
+      //TODO implement
+      case 'C':
+        Serial.println("Fade to random RGB color is not implemented");
+        break;
+
+      // Go to RGB color now
+      // 3 parameters: R, G, B values
+      //TODO implement
+      case 'n':
+        Serial.println("Go to RGB color now is not implemented");
+        break;
+
+      // Write script line
+      // 7 parameters: script num, line num (0-49), duration (ticks),
+      //  blinkm command followed by its 3 parameters
+      // Allow 20ms after writing
+      // Follow writing of script lines with an "L" command
+      case 'W':
+        Serial.println("Write script line is not implemented");
+        break;
+
+      // Read script line
+      // 2 parameters: script id, line num
+      // returns 5 values: duration (ticks), command followed by its 3
+      //                   parameters
+      case 'R':
+        Serial.println("Read script line is not implemented");
+        break;
+
+      // Set script length and repeats
+      // 3 parameters: script id, length, number of repeats
+      // 15ms complete time
+      case 'L':
+        Serial.println("Set script length is not implemented");
+        break;
+
+      // Get Current RGB Color
+      //TODO implement
+      case 'g':
+        Serial.print("Current RGB Color is ");
+        dev.send();
+        dev.write('g');
+        dev.stop();
+        dev.receive();
+        cRed = dev.read(1);
+        cGreen = dev.read(1);
+        cBlue = dev.read(1);
+        dev.stop();
+        Serial.print(cRed, HEX);
+        Serial.print(cGreen, HEX);
+        Serial.print(cBlue, HEX);
+        Serial.println();
+        break;
+
+      // Set fade speed
+      // 1 parameter: fade speed
+      case 'f':
+        fadeSpeed = parms[0];
+        if ((fadeSpeed < 1) || (fadeSpeed > 255)) {
+          Serial.println("Fade speed out of range; setting to 128");
+          fadeSpeed = 128;
+        }
+        dev.send();
+        dev.write('f');
+        dev.write(fadeSpeed);
+        dev.stop();
+        break;
+
+      // Set time adjustment; smaller numbers are faster; added to
+      // all durations of scripts
+      // 1 parameter: time adjustment
+      // TODO need to handle negative numbers
+      case 't':
+        timeAdj = parms[0];
+        if ((timeAdj < -128) || (timeAdj > 127)) {
+          Serial.println("Time adjustment is out of range; setting to 0 (default)");
+          timeAdj = 0;
+        }
+        Serial.print("Set time adjustment to ");
+        Serial.println(timeAdj);
+        dev.send();
+        dev.write('t');
+        dev.write(timeAdj);
+        dev.stop();
+        break;
+
+      // Stop light script
+      case 'o':
+        dev.send();
+        dev.write('o');
+        dev.stop();
+        break;
+
+      // Play light script
+      // 3 parameters
+      // script num (1=18)
+      // number of repeats (0 = forever)
+      // line number to start with (0 = first)
+      case 'p':
+        scriptNum = parms[0];
+        numRepeats = parms[1];
+        startLine = parms[2];
+
+        if ((scriptNum < 0) || (scriptNum > 18)) {
+          Serial.println("Light script id is out of range; setting to script 0");
+          scriptNum = 0;
+        }
+        if (numRepeats < 0) {
+          Serial.println("Number of repeats not set; setting to 0 (run forever)");
+          numRepeats = 0;
+        }
+        if (startLine < 0) {
+          Serial.println("Script starting line not set; setting to 0 (run from beginning)");
+          startLine = 0;
+        }
+        Serial.print("Play light script ");
+        Serial.print(scriptNum);
+        Serial.print(" , repeat ");
+        Serial.print(numRepeats);
+        Serial.print(" times, starting at script line ");
+        Serial.println(startLine);
+
+        // Unclear if this is useful
+        // Turn off
+        dev.send();
+        dev.write('n');
+        dev.write(0);
+        dev.write(0);
+        dev.write(0);
+        dev.stop();
+
+        dev.send();
+        dev.write('p');
+        dev.write(byte(scriptNum));
+        dev.write(byte(numRepeats));
+        dev.write(byte(startLine));
+        dev.stop();
+        break;
+
+      // Get BlinkM firmware version
+      // returns major firmware version and minor firmware version
+      case 'Z':
+        Serial.println("Get BlinkM firmware version is not implemented");
+        break;
+
+      // Talk on a new I2C address
+      // 1 parameter I2C device id
+      // Convenience routine swiped from todbot
+      case '@':
+        Serial.println("Talk on BlinkM address not set");
+        break;
+
+      // Scan for first I2C device on bus
+      // Conventience routine that just runs the starup scan
+      // Idea swiped from todbot
+      case 's':
+        Serial.println("Scan for first I2C device not implemented");
+        break;
+
+      // Scan I2C bus for all devices
+      //TODO get code from i2c_dev_scan
+      // Idea swiped from todbot
+      case 'S':
+        Serial.println("Scan I2C bus not implemented");
+        break;
+
+      // Factory reset the BlinkM
+      // Idea swiped from todbot but command collision
+      // since "R" used for reading a script line
+      // A Factory reset involves:
+      // 1. set address to 0x09
+      // 2. delay(30)
+      // 3. set startup parms (1,0,0,8,0)
+      // 4. delay(30)
+      // 5. write this script in todbot notation:
+      //   blinkm_script_line script1_lines[] = {
+      //     {  1,  {'f',   10,  00,  00}},  // set fade speed to 10
+      //     { 100, {'c', 0xff,0xff,0xff}},  // white
+      //     {  50, {'c', 0xff,0x00,0x00}},  // red
+      //     {  50, {'c', 0x00,0xff,0x00}},  // green
+      //     {  50, {'c', 0x00,0x00,0xff}},  // blue
+      //     {  50, {'c', 0x00,0x00,0x00}},  // off
+      //   };
+      //   int script1_len = 6;  // number of script lines above
+      //   BlinkM_writeScript( 0x09, 0, script1_len, 0, script1_lines);
+
+      case 'X':
+        Serial.println("Factory reset not implemented");
+        break;
+
+      default:
+        Serial.println("Unknown command.");
+    }   // end switch
+
+    inputData[0] = '\0';
+    index = 0;
+    Serial.print("Enter command: ");
+  }   // end processing command
+
+  // Blink the LED every 5 seconds
+  led.digiWrite(1);
+  delay(50);
+  led.digiWrite(0);
+  delay(4950);
+}


Added uviewstats.ino

Added uviewstats.ino

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

--- uviewstats.ino
+++ uviewstats.ino
@@ -0,0 +1,210 @@
+#include <MicroView.h>
+
+#define X 64
+#define Y 48
+#define SPEED 19200
+
+void setup() {
+  Serial.begin(SPEED);    // start serial communication
+  uView.begin();          // start microview
+}
+
+void loop() {
+  String input;
+
+  char data[255];
+  char action;
+  char needle[] = ",";
+  char *result, *load_last, *mem = NULL;
+
+  byte i, width, core, load;
+
+  input = read_input();
+  input.substring(1).toCharArray(data, 255);
+  action = input[0];
+
+  uView.clear(PAGE);      // clear page
+
+  switch (action) {
+  //
+  // init core number
+  //
+
+  case '0':
+    result = strtok(data, needle);
+    core = atoi(result);
+    width = (int)(X / core);
+    width--;
+    result = strtok(NULL, needle);
+    mem = result;
+
+    uView.setCursor(2, 0);
+    uView.print("uViewStats");
+    uView.setCursor(2, 32);
+    uView.print("Cores    ");
+    uView.print(core);
+    uView.setCursor(2, 40);
+    uView.print("Memory  ");
+    uView.print(mem);
+    uView.lineH(0, 8, 64);
+    uView.display();
+
+    scroll_text("Version 1.1 @fauveauarmel", 0, 64, 16, 10);
+
+    break;
+
+  //
+  // view core usage
+  //
+
+  case '1':
+    i = 0;
+    result = strtok(data, needle);
+    core = atoi(result);
+    width = (int)(X / core);
+    width--;
+    result = strtok(NULL, needle);
+
+    while (result != NULL) {
+      uView.setCursor((width * i) + i + 1, 0);
+      uView.print(result);
+      load = atoi(result);
+      load = map(load, 0, 100, 1, 40);
+
+      for (int j = (Y - 1); j > (Y - load); j -= 2) {
+        uView.lineH((width * i) + i, j, width);
+      }
+
+      result = strtok(NULL, needle);
+      i++;
+    }
+
+    uView.lineH(0, 8, 64);
+    break;
+
+  //
+  // view cpu usage
+  //
+
+  case '2':
+    i = 0;
+    result = strtok(data, needle);
+    while (result != NULL) {
+      load = atoi(result);
+      load_last = result;
+      load = map(load, 0, 100, 1, 40);
+
+      uView.lineV(i, (Y - load), Y);
+
+      result = strtok(NULL, needle);
+      i++;
+    }
+
+    uView.setCursor(8, 0);
+    uView.print("CPU ");
+    uView.print(load_last);
+    uView.print(" %");
+    uView.lineH(0, 8, 64);
+    break;
+
+  //
+  // view memory usage
+  //
+
+  case '3':
+    i = 16;
+    result = strtok(data, needle);
+    while (result != NULL) {
+      uView.setCursor(1, i);
+      uView.print(result);
+
+      result = strtok(NULL, needle);
+
+      i += 8;
+    }
+
+    uView.setCursor(14, 0);
+    uView.print("Memory");
+    uView.lineH(0, 8, 64);
+    break;
+
+  //
+  // view disk usage
+  //
+
+  case '4':
+    i = 16;
+    result = strtok(data, needle);
+    while (result != NULL) {
+      uView.setCursor(1, i);
+      uView.print(result);
+
+      result = strtok(NULL, needle);
+
+      i += 8;
+    }
+
+    uView.setCursor(22, 0);
+    uView.print("Disk");
+    uView.lineH(0, 8, 64);
+    break;
+
+  //
+  // view net usage
+  //
+
+  case '5':
+    i = 16;
+    result = strtok(data, needle);
+    while (result != NULL) {
+      uView.setCursor(1, i);
+      uView.print(result);
+
+      result = strtok(NULL, needle);
+
+      i += 8;
+    }
+
+    uView.setCursor(12, 0);
+    uView.print("Network");
+    uView.lineH(0, 8, 64);
+    break;
+
+  }
+  uView.display();
+}
+
+String read_input() {
+  String input;
+
+  while (input.length() == 0) {
+    if (Serial.available() > 0) {
+      input = Serial.readStringUntil('\r');
+    }
+  }
+
+  return input;
+}
+
+void scroll_text(char* message, int font_type, int x, int y, int wait) {
+  int size, step, width;
+
+  uView.setFontType(font_type);   // sets font
+  step = uView.getFontWidth();
+
+  size = strlen(message);
+  while (true) {
+    for (int i = 0; i < size; i++) {
+      int j = x+step*i;
+      if ((j + step > 0) && (j < X)) uView.drawChar(j, y, message[i]);
+    }
+    x--;
+    uView.display();
+    delay(wait);
+
+    if (x < -size * step) {
+      x = 64;
+      break;
+    }
+  }
+}


Initial

Initial

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

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


Add test sketch for SR-04 ultasound sensors

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

--- experiments/NewPing4Sensors/NewPing4Sensors.ino
+++ experiments/NewPing4Sensors/NewPing4Sensors.ino
@@ -0,0 +1,53 @@
+
+#include <NewPing.h>
+
+#define SONAR_NUM 4 // Number or sensors.
+#define MAX_DISTANCE 200 // Maximum distance (in cm) to ping.
+#define PING_INTERVAL 33 // Milliseconds between sensor pings (29ms is about the min to avoid cross-sensor echo).
+
+unsigned long pingTimer[SONAR_NUM]; // Holds the times when the next ping should happen for each sensor.
+unsigned int cm[SONAR_NUM];         // Where the ping distances are stored.
+uint8_t currentSensor = 0;          // Keeps track of which sensor is active.
+
+NewPing sonar[SONAR_NUM] = {     // Sensor object array.
+  NewPing(11, 12, MAX_DISTANCE), // Each sensor's trigger pin, echo pin, and max distance to ping.
+  NewPing(9, 10, MAX_DISTANCE),
+  NewPing(2, 3, MAX_DISTANCE),
+  NewPing(5, 6, MAX_DISTANCE)
+};
+
+void setup() {
+  Serial.begin(115200);
+  pingTimer[0] = millis() + 75;           // First ping starts at 75ms, gives time for the Arduino to chill before starting.
+  for (uint8_t i = 1; i < SONAR_NUM; i++) // Set the starting time for each sensor.
+    pingTimer[i] = pingTimer[i - 1] + PING_INTERVAL;
+}
+
+void loop() {
+  for (uint8_t i = 0; i < SONAR_NUM; i++) { // Loop through all the sensors.
+    if (millis() >= pingTimer[i]) {         // Is it this sensor's time to ping?
+      pingTimer[i] += PING_INTERVAL * SONAR_NUM;  // Set next time this sensor will be pinged.
+      if (i == 0 && currentSensor == SONAR_NUM - 1) oneSensorCycle(); // Sensor ping cycle complete, do something with the results.
+      sonar[currentSensor].timer_stop();          // Make sure previous timer is canceled before starting a new ping (insurance).
+      currentSensor = i;                          // Sensor being accessed.
+      cm[currentSensor] = 0;                      // Make distance zero in case there's no ping echo for this sensor.
+      sonar[currentSensor].ping_timer(echoCheck); // Do the ping (processing continues, interrupt will call echoCheck to look for echo).
+    }
+  }
+  // The rest of your code would go here.
+}
+
+void echoCheck() { // If ping received, set the sensor distance to array.
+  if (sonar[currentSensor].check_timer())
+    cm[currentSensor] = sonar[currentSensor].ping_result / US_ROUNDTRIP_CM;
+}
+
+void oneSensorCycle() { // Sensor ping cycle complete, do something with the results.
+  for (uint8_t i = 0; i < SONAR_NUM; i++) {
+    Serial.print(i);
+    Serial.print("=");
+    Serial.print(cm[i]);
+    Serial.print("cm ");
+  }
+  Serial.println();
+}


Add files via upload

Add files via upload

Pathfinding implemented in arduino by using ported std library:

https://github.com/maniacbug/StandardCplusplus

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

--- Pathfinding_arduino.ino
+++ Pathfinding_arduino.ino
@@ -0,0 +1,215 @@
+#include <StandardCplusplus.h>
+#include <system_configuration.h>
+#include <unwind-cxx.h>
+#include <utility.h>
+
+#include <vector>
+//#include <Math.h>
+#include <iostream>
+using namespace std;
+
+
+
+void setup() {
+  // put your setup code here, to run once:
+   Serial.begin(57600);
+   gridInit();
+  FindPath(0,0,10,10);
+
+}
+
+void loop() {
+  // put your main code here, to run repeatedly:
+
+//    gridInit();
+//  FindPath(0,0,10,10);
+ // cout << "[""]" << "\n";
+
+}
+
+
+
+
+
+
+
+struct node
+  {
+    int posx;
+    int posy;
+    int gcost;
+    int hcost;
+    bool walkable;
+
+    struct node* parent;
+  };
+
+struct node grid[20][20];
+int gridsizex = 20;
+
+int gridsizey = 20;
+void gridInit(){
+  for (int i = 0; i < gridsizex; i++)
+  {
+    for (int j = 0; j < gridsizey; j++)
+    {
+      grid[i][j].posx = i;
+      grid[i][j].posy = j;
+      grid[i][j].walkable = true;
+    }
+  }
+  grid[0][10].walkable = false;
+  grid[0][9].walkable = false;
+  grid[1][10].walkable = false;
+  grid[2][9].walkable = false;
+
+
+}
+
+//using structures to represent nodes for open and closed lists
+vector<struct node *> open; // nodes that need to be evaluated
+vector<struct node *> closed; //already been evaluated
+
+vector<struct node *> neighbours;
+
+
+int abs(int i) {
+  return i >= 0 ? i : -i;
+}
+
+struct node * get_node(int x, int y){
+
+  return &grid[x][y];
+
+}
+
+//calculate fcost
+int fcost(struct node *a)
+{
+  return a->gcost + a->hcost;
+}
+
+int getDistance(struct node *a, struct node *b){
+  int dstX = abs(a->posx - b->posx);
+  int dstY = abs(a->posy - b->posy);
+
+  return dstX + dstY;
+}
+
+bool inClosed(struct node *current)
+{
+  for(int i = 0; i< closed.size(); i++){
+    if (current == closed[i])
+      return true;
+  }
+  return false;
+}
+
+bool inOpen(struct node *current)
+{
+  for(int i = 0; i< open.size(); i++){
+    if (current == open[i])
+      return true;
+  }
+  return false;
+
+}
+
+
+
+void printnode(struct node* node){ // print this bitch
+ Serial.print( node->posx);
+  Serial.print(" ");
+  Serial.println(node->posy);
+}
+
+void RetracePath(struct node *startNode, struct node *endNode){
+ // cout << "[retrace]" << "\n";
+  vector<struct node *> path;
+  struct node *currentNode = endNode;
+
+  // TODO WTF DO WE IF THERES NO PATH BRAH
+  while(currentNode != startNode){
+    path.push_back(currentNode);
+    currentNode = currentNode->parent;
+  Serial.print("[");
+   Serial.print(currentNode->posx);
+    Serial.print(", ");
+     Serial.print(currentNode->posy);
+      Serial.println("]");
+
+    if (!currentNode) {
+      // THERE'S NO PATH THO.
+      break;
+
+
+    }
+  }
+}
+void GetNeighbours(struct node *current){
+  neighbours.clear();
+
+  for(int x = -1; x<=1;x++){
+    for (int y = -1; y <= 1; y++){
+      if(abs(x)==abs(y))
+        continue;
+
+      int checkX = current->posx + x;
+      int checkY = current->posy + y;
+
+      if(checkX >= 0 && checkX < gridsizex && checkY >= 0 && checkY<gridsizey){
+        neighbours.push_back(&grid[checkX][checkY]);
+      }
+    }
+  }
+  return;
+}
+void FindPath (int start_x, int start_y, int target_x, int target_y){
+  struct node *startNode = get_node(start_x,start_y);
+  struct node *targetNode = get_node(target_x,target_y);
+  //cout << "[1]" << "\n";
+  open.push_back(startNode);
+  //cout << open[0]->posy << "\n";
+
+  while(open.size() > 0 ){
+    //cout << "[2]" << "\n";
+    struct node *currentNode = open[0];
+    int index = 0;
+
+    for (int i =1; i<open.size(); i++){
+      if(fcost(open[i]) < fcost(currentNode) || fcost(open[i]) == fcost(currentNode) && open[i]->hcost < currentNode->hcost){
+        currentNode = open[i];
+        index = i;
+
+      }
+
+    }
+    open.erase(open.begin() + index);
+    closed.push_back(currentNode);
+    printnode(currentNode);
+    if(currentNode == targetNode){
+      RetracePath(startNode, targetNode);
+      return;
+    }
+
+    GetNeighbours(currentNode);
+    for(int i = 0; i< neighbours.size(); i++){
+      if (!neighbours[i]->walkable || inClosed(neighbours[i])){
+        continue;
+      }
+      int newMovementCostToNeighbour = currentNode->gcost + getDistance(currentNode,neighbours[i]);
+      if(newMovementCostToNeighbour < neighbours[i]->gcost || !inOpen(neighbours[i])){
+        neighbours[i]->gcost = newMovementCostToNeighbour;
+        neighbours[i]->hcost = getDistance(neighbours[i], targetNode);
+        neighbours[i]->parent = currentNode;
+
+        if(!inOpen(neighbours[i]))
+          open.push_back(neighbours[i]);
+      }
+
+    }
+  }
+}
+
+
+


Android bluetooth example added (tested with my android app)

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

--- src/bluetooth_example_for_android/bluetooth_example_for_android.ino
+++ src/bluetooth_example_for_android/bluetooth_example_for_android.ino
@@ -0,0 +1,22 @@
+char incomingByte;  // incoming data
+int  LED = 13;      // LED pin
+
+void setup() {
+  Serial.begin(9600); // initialization
+  pinMode(LED, OUTPUT);
+  Serial.println("Press 1 to LED ON or 0 to LED OFF...");
+}
+
+void loop() {
+  if (Serial.available() > 0) {  // if the data came
+    incomingByte = Serial.read(); // read byte
+    if(incomingByte == '0') {
+       digitalWrite(LED, LOW);  // if 1, switch LED Off
+       Serial.println("LED OFF. Press 1 to LED ON!");  // print message
+    }
+    if(incomingByte == '1') {
+       digitalWrite(LED, HIGH); // if 0, switch LED on
+       Serial.println("LED ON. Press 0 to LED OFF!");
+    }
+  }
+}


Added Beacon example

Added Beacon example

Broadcasts a message every second

error: pathspec 'Code/Examples/NetworkV1/Beacon/Beacon.ino' did not match any file(s) known to git

--- Code/Examples/NetworkV1/Beacon/Beacon.ino
+++ Code/Examples/NetworkV1/Beacon/Beacon.ino
@@ -0,0 +1,115 @@
+/**
+ * This file is part of the Meshwork project.
+ *
+ * Copyright (C) 2013, Sinisha Djukic
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA  02111-1307  USA
+ */
+#include <stdlib.h>
+#include "Cosa/Trace.hh"
+#include "Cosa/Types.h"
+#include "Cosa/IOStream.hh"
+#include "Cosa/IOStream/Driver/UART.hh"
+#include "Cosa/Watchdog.hh"
+#include "Cosa/RTC.hh"
+#include "Cosa/Wireless.hh"
+#include <Meshwork.h>
+#include "Meshwork/L3/Network.h"
+#include "Meshwork/L3/NetworkV1/NetworkV1.h"
+#include "Meshwork/L3/NetworkV1/NetworkV1.cpp"
+#include "Meshwork/L3/NetworkV1/NetworkSerial.h"
+#include "Meshwork/L3/NetworkV1/NetworkSerial.cpp"
+#include "Utils/LineReader.h"
+
+#if defined (__ARDUINO_MEGA__)
+#include "Cosa/IOBuffer.hh"
+#endif
+
+// Select Wireless device driver
+// #include "Cosa/Wireless/Driver/CC1101.hh"
+// CC1101 rf(0xC05A, 0x01);
+
+#include "Cosa/Wireless/Driver/NRF24L01P.hh"
+//NRF24L01P rf(0xC05A, 0x01);
+
+//#define RBBB
+
+//RBBB
+#if defined (RBBB)
+#define BOARD_VARIANT	1
+NRF24L01P rf(0x0001, 0x01,
+	    Board::DigitalPin(Board::D7),
+	    Board::DigitalPin(Board::D8),
+	    Board::ExternalInterruptPin(Board::EXT0));
+#else
+
+//Mega
+#if defined (__ARDUINO_MEGA__)
+#define BOARD_VARIANT	2
+NRF24L01P rf(0x0001, 0x01,
+	    Board::DigitalPin(Board::D53),
+	    Board::DigitalPin(Board::D48),
+	    Board::ExternalInterruptPin(Board::EXT2));
+
+//Mini Pro or Nano
+#else
+#define BOARD_VARIANT	3
+NRF24L01P rf(0x0001, 0x01,
+	    Board::DigitalPin(Board::D10),
+	    Board::DigitalPin(Board::D3),
+	    Board::ExternalInterruptPin(Board::EXT0));
+#endif
+
+#endif
+
+static const uint16_t 	BEACON_NWK_ID 		= 1;
+static const uint8_t 	BEACON_CHANNEL_ID 	= 0;
+static const uint8_t 	BEACON_NODE_ID 		= 100;
+static const uint8_t 	BEACON_BCAST_PORT 	= 0;
+static const char 		BEACON_BCAST_MSG[] 	= "*BEACON*";
+static const uint8_t	BEACON_BCAST_MSG_LEN = sizeof(BEACON_BCAST_MSG) - 1;//without null termination
+
+Meshwork::L3::NetworkV1::NetworkV1 mesh(&rf, NULL);
+
+void setup()
+{
+  uart.begin(115200);
+  trace.begin(&uart, PSTR("Beacon: started"));
+  trace << endl;
+
+  trace << PSTR("Network ID: ") << BEACON_NWK_ID << endl;
+  trace << PSTR("Channel ID: ") << BEACON_CHANNEL_ID << endl;
+  trace << PSTR("Node ID: ") << BEACON_NODE_ID << endl;
+  trace << PSTR("Bcast port: ") << BEACON_BCAST_PORT << endl;
+  trace << PSTR("Bcast msg len: ") << BEACON_BCAST_MSG_LEN << endl;
+
+  mesh.setNetworkID(BEACON_NWK_ID);
+  mesh.setChannel(BEACON_CHANNEL_ID);
+  mesh.setNodeID(BEACON_NODE_ID);
+
+  uint8_t mode = SLEEP_MODE_IDLE;
+  Watchdog::begin(16, mode);
+  rf.set_sleep(mode);
+  RTC::begin();
+}
+
+void loop()
+{
+	trace << PSTR("Broadcasting...") << endl;
+	mesh.broadcast(BEACON_BCAST_PORT, BEACON_BCAST_MSG, BEACON_BCAST_MSG_LEN);
+	SLEEP(1);
+}
+


temp_commit

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

--- ArduinoSensorBoard/ArduinoSensorBoard_ino/ArduinoSensorBoard_ino.ino
+++ ArduinoSensorBoard/ArduinoSensorBoard_ino/ArduinoSensorBoard_ino.ino
@@ -0,0 +1,134 @@
+#include <SPI.h>
+#include "nRF24L01.h"
+#include "RF24.h"
+#include "DHT.h"
+//#include "printf.h"
+
+#define DHTPIN 2
+#define DHTTYPE DHT11
+#define COMMAND_LENGHT 23
+RF24 radio(9,10);
+DHT dht(DHTPIN, DHTTYPE);
+
+const uint64_t pipes[2] = { 0xF0F0F0F001LL, 0xF0F0F0F002LL };
+const byte shortAddr = 0x02;
+int switchsPins[] = {13};
+int switchesBytes[] = {13};
+int switchStatus[] = {0};
+void setup(void)
+{
+  Serial.begin(57600);
+
+  dht.begin();
+  radio.begin();
+
+  radio.setAutoAck(false);
+  radio.setRetries(15,15);
+  radio.setPALevel(RF24_PA_MAX);
+  radio.openReadingPipe(1,pipes[1]);
+  radio.openWritingPipe(pipes[0]);
+
+  radio.startListening();
+
+  // Testing switch on/off
+   pinMode(switchsPins[0], OUTPUT);
+
+
+
+}
+
+void loop(void)
+{
+  byte command[COMMAND_LENGHT] ;
+  byte *ptr = &command[0];
+  uint8_t pipenum = 0;
+  if ( radio.available(&pipenum))
+    {
+
+      bool done = false;
+      while (!done)
+      {
+        done = radio.read( ptr, sizeof(byte[COMMAND_LENGHT]) );
+        delay(10);
+      }
+      if (pipenum==1){
+          runCommand(ptr);
+      }
+      Serial.println(ptr[1]);
+
+      radio.stopListening();
+      radio.write(ptr, sizeof(byte[COMMAND_LENGHT]));
+      radio.startListening();
+    }
+
+
+}
+void runCommand(byte *ptr)
+{
+  Serial.println(ptr[0]);
+  if(!ptr[0]){
+    readSensors(ptr);
+  }else{
+    writeSensors(ptr);
+  }
+
+}
+void readSensors(byte* ptr){
+  readTemp(ptr);
+  readHum(ptr);
+  readLum(ptr);
+  readSwitch(ptr);
+}
+
+void writeSensors(byte* ptr){
+  writeSwitch(ptr);
+  readSwitch(ptr);
+}
+
+void readTemp(byte* ptr){
+  float t = dht.readTemperature();
+  if (!isnan(t)){
+    ptr[2] = (byte)t;
+    ptr[1] = 255;
+  }else{
+    ptr[1] = 13;
+  }
+
+
+}
+void readHum(byte* ptr){
+  float h = dht.readHumidity();
+  if (!isnan(h)){
+    ptr[3] = (byte)h;
+    ptr[1] = 255;
+  }else{
+    ptr[1] = 14;
+  }
+}
+void readLum(byte* ptr){
+  ptr[4] = 255;
+  ptr[1] = 255;
+
+}
+
+void readSwitch(byte* ptr){
+  for(int i = 0; i < sizeof(switchesBytes); i++){
+    ptr[switchesBytes[i]]=switchStatus[i];
+
+  }
+  ptr[1] = 255;
+}
+
+void writeSwitch(byte* ptr){
+  for(int i = 0; i < sizeof(switchesBytes); i++){
+    if(ptr[switchesBytes[i]]){
+         digitalWrite(switchsPins[i], HIGH);
+    }else{
+        digitalWrite(switchsPins[i], LOW);
+    }
+    switchStatus[i] = ptr[switchesBytes[i]];
+    ptr[1] = 255;
+  }
+}
+
+


arduino sketch added

arduino sketch added

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

--- BasicHttpClient.ino/BasicHttpClient.ino.ino
+++ BasicHttpClient.ino/BasicHttpClient.ino.ino
@@ -0,0 +1,97 @@
+#include <Arduino.h>
+
+#include <ESP8266WiFi.h>
+#include <ESP8266WiFiMulti.h>
+
+#include <ESP8266HTTPClient.h>
+
+#define USE_SERIAL Serial
+#define Webpage "http://arduinoday.azurewebsites.net/data.txt"
+#define UP 0 //up pin
+#define DOWN 1 //down pin
+#define LEFT 2 //left pin
+#define RIGHT 3 //right pin
+ESP8266WiFiMulti WiFiMulti;
+int index,last,msec,dir;
+
+void moveDir(int d,int t){
+    switch(d){
+    case 0:
+      digitalWrite(UP,HIGH);
+      delay(t);
+      digitalWrite(UP,LOW);
+      break;
+    case 1:
+      digitalWrite(DOWN,HIGH);
+      delay(t);
+      digitalWrite(DOWN,LOW);
+      break;
+    case 2:
+      digitalWrite(LEFT,HIGH);
+      delay(t);
+      digitalWrite(LEFT,LOW);
+      break;
+    case 3:
+      digitalWrite(RIGHT,HIGH);
+      delay(t);
+      digitalWrite(RIGHT,LOW);
+      break;
+      }
+}
+void setup() {
+    pinMode(UP,OUTPUT);
+    pinMode(DOWN,OUTPUT);
+    pinMode(LEFT,OUTPUT);
+    pinMode(DOWN,OUTPUT);
+    USE_SERIAL.begin(115200);
+    USE_SERIAL.println();
+    USE_SERIAL.println();
+    USE_SERIAL.println();
+// wait for wifi module to turn on
+    for(uint8_t t = 4; t > 0; t--) {
+        USE_SERIAL.printf("[SETUP] WAIT %d...\n", t);
+        USE_SERIAL.flush();
+        delay(1000);
+    }
+//network and password
+    WiFiMulti.addAP("SSID", "PASSWORD");
+    last=0;
+}
+
+void loop() {
+    // wait for WiFi connection
+    if((WiFiMulti.run() == WL_CONNECTED)) {
+
+        HTTPClient http;
+
+        USE_SERIAL.print("[HTTP] begin...\n");
+        //connect to address
+        http.begin(Webpage); //HTTP
+
+        USE_SERIAL.print("[HTTP] GET...\n");
+         int httpCode = http.GET();
+
+        // httpCode will be negative on error
+        if(httpCode > 0) {
+            // HTTP header has been send and Server response header has been handled
+            USE_SERIAL.printf("[HTTP] GET... code: %d\n", httpCode);
+
+            // file found at server
+            if(httpCode == HTTP_CODE_OK) {
+                String payload = http.getString();
+                USE_SERIAL.println(payload);
+                sscanf(payload,"%d %d : %d",index,dir,msec);
+                if(index>last){
+                  moveDir(dir,msec);
+                }
+            }
+        } else {
+            USE_SERIAL.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
+        }
+
+        http.end();
+    }
+
+    delay(10000);
+}
+


Added inital ablinkin test code of slashes.

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

--- ablinkin/ablinkin.ino
+++ ablinkin/ablinkin.ino
@@ -0,0 +1,35 @@
+//  A'blinkin
+//  Julien Eid
+//  Josh McSavaney
+
+#include "letters.c"
+
+int dataPin = P1_0;        //Define which pins will be used for the Shift Register control
+int latchPin = P1_4;
+int clockPin = P1_5;
+
+int byte1 = 0;         //The counter for storing the byte #1 value
+int byte2 = 0;         //The counter for storing the byte #2 value
+int val = 0;
+
+int incomingByte = 0;   // for incoming serial data
+
+void setup()
+{
+  pinMode(dataPin, OUTPUT);       //Configure each IO Pin
+  pinMode(latchPin, OUTPUT);
+  pinMode(clockPin, OUTPUT);
+}
+
+void loop()
+{
+   char eye [] = "/\\";
+   for( byte2 = 1; byte2 >= 0; byte2--)
+       for (byte1 = 3; byte1 >= 0; byte1--)
+       {
+           digitalWrite(latchPin, LOW);           //Pull latch LOW to start sending data
+           shiftOut(dataPin, clockPin, LSBFIRST, get_char_section(eye[byte2], byte1)<<2); //Send the data byte 1
+           digitalWrite(latchPin, HIGH);          //Pull latch HIGH to stop sending data
+           delay(100);
+       }
+}


jeeje

jeeje

error: pathspec 'Time' did not match any file(s) known to git
error: pathspec 'machine' did not match any file(s) known to git
error: pathspec 'countdown' did not match any file(s) known to git
error: pathspec 'and' did not match any file(s) known to git
error: pathspec 'crash' did not match any file(s) known to git
error: pathspec 'with' did not match any file(s) known to git
error: pathspec 'Dotmatrixes/testje/testje.ino' did not match any file(s) known to git


Criando box-001.ino

Criando box-001.ino

Código arduino para envio dos dados da box-001 ao servidor capibalabs.

error: pathspec 'sensores-nodemcu/box-001.ino' did not match any file(s) known to git

--- sensores-nodemcu/box-001.ino
+++ sensores-nodemcu/box-001.ino
@@ -0,0 +1 @@
+


no message

no message

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

--- example/si7051demo/si7051demo.ino
+++ example/si7051demo/si7051demo.ino
@@ -0,0 +1,39 @@
+/**************************************************************************************
+
+This is example for ClosedCube Si7051 0.1C Digital Temperature Sensor breakout board
+
+Initial Date: 15-May-2016
+
+Hardware connections for Arduino Uno:
+	VDD to 3.3V DC
+	SCL to A5
+	SDA to A4
+	GND to common groud
+
+Written by AA for ClosedCube
+
+MIT License
+
+**************************************************************************************/
+
+#include <Wire.h>
+#include "ClosedCube_Si7051.h"
+
+ClosedCube_Si7051 si7051;
+
+void setup()
+{
+	Serial.begin(9600);
+	Serial.println("ClosedCube Si7051 Arduino Test");
+
+	si7051.begin(0x40);
+}
+
+void loop()
+{
+	Serial.print("T=");
+	Serial.print(si7051.readTemperature());
+	Serial.println("C");
+	delay(300);
+}
+


baton

baton

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

--- baton/baton.ino
+++ baton/baton.ino
@@ -0,0 +1,356 @@
+#include "FastLED.h"
+#define qsubd(x, b)  ((x>b)?255:0)  // Digital unsigned subtraction macro. if result <0, then => 0. Otherwise, take on fixed value.
+#define qsuba(x, b)  ((x>b)?x-b:0)         // Analog Unsigned subtraction macro. if result <0, then => 0
+#define LED_DT 7              // Data pin to connect to the strip.
+#define COLOR_ORDER GRB       // Are they RGB, GRB or what??
+#define LED_TYPE WS2812B      // Don't forget to change LEDS.addLeds
+#define NUM_LEDS 300         // Number of LED's.
+struct CRGB leds[NUM_LEDS];   // Initialize our LED array.
+uint8_t max_bright = 255;     // Overall brightness definition. It can be changed on the fly.
+unsigned long previousMillis; // Store last time the strip was updated.
+int hue = 50;                 // Starting hue.
+bool firstTimeRunningThroughPattern = true;
+
+#define BEAUTIFUL_SPARKLES 1
+#define NIGHT_SPARKLES 2
+// #define SINGLE_COLOR_SPARKLES 3
+#define DAVE 3
+#define WORMS 4
+#define DISCO_BARBER_1 5
+#define DISCO_TWIRL 6
+#define DISCO_BARBER_2 7
+#define DISCO_TWIRL_2 8
+
+int maxPatternId = 8;
+int rotationInMillseconds = 4000; // 20 seconds for production
+
+bool holdPattern = false;
+int patternId = BEAUTIFUL_SPARKLES;
+ // bool holdPattern = true;
+ // int patternId = DISCO_TWIRL;
+
+void setup() {
+  delay(50);
+  Serial.begin(57600);
+  LEDS.addLeds<LED_TYPE, LED_DT, COLOR_ORDER>(leds, NUM_LEDS);
+  FastLED.setBrightness(max_bright);
+  set_max_power_in_volts_and_milliamps(5, 10000);
+  randomSeed(analogRead(0));
+}
+
+uint8_t offset = 0;
+int ms = 0;
+
+void dave() {
+
+
+  for (int k=0; k<NUM_LEDS-1; k++) {
+
+    uint8_t k8 = k;
+    uint8_t hue = (k/15 * 255) + (offset*5);
+    uint8_t saturation = rand() % 255 > 252 ? 0 : 255; //NUM_LEDS - (k+offset*10);
+    uint8_t value = k8 % 14 == offset % 14 ? 200 : 40; //NUM_LEDS- (k+offset*10);
+    if(saturation == 0){
+      value = 255;
+    }
+
+    leds[k] = CHSV(hue, saturation, value);
+
+//    int thisbright = qsubd(cubicwave8((k*-allfreq)+thisphase), thiscutoff);      // qsub sets a minimum value called thiscutoff. If < thiscutoff, then bright = 0. Otherwise, bright = 128 (as defined in qsub)..
+//    leds[k] += CHSV(thishue + k + thisphase / 5, allsat, thisbright);                               // Assigning hues and brightness to the led array.  }
+
+  }
+
+  EVERY_N_MILLISECONDS(1000/24){
+    ms++;
+    if(ms % 3 == 0){
+      offset++;
+    }
+//    if(ms < 50){
+//      offset++;
+//    } else if(ms % 10 == 0){
+//      offset++;
+//    } else if(ms > 10 * 8){
+//      ms = 0;
+//    }
+  }
+
+
+
+
+//  int daveDelay;
+//  EVERY_N_MILLISECONDS(1){
+//      ms += 10;
+//      uint8_t scale = 20;
+//      uint8_t ot =  ms % (scale * 2);
+//      if(ot < scale) {
+//      // Up
+//      daveDelay = ot * 2;
+//      } else {
+//        // Down
+//        daveDelay = (scale - (ot - scale))*2;
+//      }
+//  }
+//
+//  delay(daveDelay*8);
+}
+
+int numberOfSparkles = 1;
+bool increasing = true;
+
+int upAndDownBy(int value, int difference) {
+  if (value < 20 && increasing) {
+    value += difference;
+  } else if (value > 1) {
+    value -= difference;
+    increasing = false;
+  } else {
+    increasing = true;
+    value += difference;
+  }
+  return value;
+}
+
+void nightSparkles() {
+  if (firstTimeRunningThroughPattern) {
+    hue = 200;
+//    numberOfSparkles = 10;
+  }
+  fadeToBlackBy(leds, NUM_LEDS, 180);
+  numberOfSparkles = upAndDownBy(numberOfSparkles, 1);
+  for (int i = 0; i < numberOfSparkles; i++) {
+    int pos = random16(NUM_LEDS);
+    leds[pos] = CHSV(hue, 180, 255);
+  }
+  for (int i = 0; i < numberOfSparkles; i++) {
+    leds[random16(NUM_LEDS)] = CHSV(hue, 200, 20);
+  }
+  hue += 1;
+  delay(6);
+}
+
+void beautifulSparkles() {
+  fadeToBlackBy(leds, NUM_LEDS, 200);
+  numberOfSparkles = upAndDownBy(numberOfSparkles, 1);
+  for (int i = 0; i < numberOfSparkles * 3; i++) {
+    int pos = random16(NUM_LEDS);
+    leds[pos] = CHSV(hue + (pos / 7), 240, 255);
+  }
+  hue += 10;
+  delay(10);
+}
+
+// void sparkles() {
+//   fadeToBlackBy(leds, NUM_LEDS, 200);
+//   numberOfSparkles = upAndDownBy(numberOfSparkles, 1);
+//   for (int i = 0; i < numberOfSparkles * 4; i++) {
+//     int pos = random16(NUM_LEDS);
+//     leds[pos] = CHSV(hue, 240, 255);
+//   }
+//   hue += 1;
+// }
+
+uint8_t numberOfWorms = 4;
+uint8_t wormsFadeRate = 80; // Very low value = longer trails.
+uint8_t wormsHueIncrement = 2; // Incremental change in hue between each dot.
+uint8_t wormsStartingHue = 180; // The current hue
+uint8_t wormsBaseBeat = 10; // Higher = faster movement.
+
+void worms() {
+  fadeToBlackBy(leds, NUM_LEDS, wormsFadeRate);
+  for ( int i = 0; i < numberOfWorms; i++) {
+    for ( int j = 0; j < 20; j++) {
+      leds[beatsin16(wormsBaseBeat + i + numberOfWorms, 0, NUM_LEDS - 20) + j] += CHSV(wormsStartingHue, 180, 255);
+    }
+    wormsStartingHue += wormsHueIncrement;
+    if (wormsStartingHue > 270) {
+      wormsStartingHue = 180;
+    }
+  }
+}
+
+uint8_t discoBarberFrequency = 3;
+int     discoBarberPhase = 0;
+uint8_t discoBarberCutoff = 120;
+uint8_t discoBarberSaturation = 240;
+
+void discoBarber() {
+  if (patternId == DISCO_BARBER_1) {
+    discoBarberFrequency = 5;
+    discoBarberPhase += 24;
+  } else {
+    discoBarberFrequency = 4;
+    discoBarberPhase += 10;
+  }
+
+  hue = hue + 1;
+
+  for (int k = 0; k < NUM_LEDS - 1; k++) {
+    // qsub sets a minimum value called discoBarberCutoff. If < discoBarberCutoff, then bright = 0. Otherwise, bright = 128 (as defined in qsub)..
+    int _brightness = qsubd(cubicwave8((k * discoBarberFrequency) + discoBarberPhase), discoBarberCutoff);
+    leds[k] = CHSV(0, 0, 0);                                        // First set a background colour, but fully saturated.
+
+    // Sparkles!
+    if (random(1000) > 990) {
+      leds[k] = CHSV(255, 0, 255);
+    }
+
+    if (patternId == DISCO_BARBER_1) {
+      // original disco barber 1
+      // leds[k] += CHSV(hue+k/5, discoBarberSaturation, _brightness);                             // Then assign a hue to any that are bright enough.
+      leds[k] += CHSV(hue * 10 + k / 2, discoBarberSaturation, _brightness);                             // Then assign a hue to any that are bright enough.
+    } else {
+      leds[k] += CHSV(hue * -20 + k / 2, discoBarberSaturation, _brightness);                       // Then assign a hue to any that are bright enough.
+    }
+  }
+}
+
+//int partySeed;
+//int partySeedDirection = true;
+//
+//void party() {
+//  int partySeedLength = 1500;
+//  if (firstTimeRunningThroughPattern) {
+//    partySeed = 0;
+//  } else {
+//    partySeed += partySeedDirection ? 20 : -20;
+//    if (partySeed > NUM_LEDS - partySeedLength) {
+//      partySeedDirection = false;
+//    } else if (partySeed < 0) {
+//      partySeedDirection = true;
+//    }
+//  }
+//  EVERY_N_MILLISECONDS(100) {
+//    hue += 5;
+//  }
+//  fadeToBlackBy(leds, NUM_LEDS, 80);
+//  int brightness = 255;
+//  int saturation = 200;
+//  int pos;
+//
+//  for (int i = 0; i < 3; i++) {
+//    pos = random(partySeed - partySeedLength, partySeed + partySeedLength);
+//    for (int i = pos; i <= pos + 50; i++) {
+//      brightness *= 0.97;
+//      if (i < NUM_LEDS && i > 0) {
+//        leds[i] = CHSV(hue, saturation, brightness);
+//      }
+//    }
+//    brightness = 255;
+//    saturation = 255;
+//    for (int j = pos; j >= pos - 50; j--) {
+//      brightness *= 0.97;
+//      if (j < NUM_LEDS && j > 0) {
+//        leds[j] = CHSV(hue, saturation, brightness);
+//      }
+//    }
+//  }
+//}
+
+uint8_t thishue = 0;                                          // You can change the starting hue value for the first wave.
+uint8_t thisrot = 18;                                          // You can change how quickly the hue rotates for this wave. Currently 0.
+uint8_t allsat = 255;                                         // I like 'em fully saturated with colour.
+bool thisdir = 0;                                             // You can change direction.
+int8_t thisspeed = 16;                                         // You can change the speed, and use negative values.
+uint8_t allfreq = 1;                                         // You can change the frequency, thus overall width of bars.
+int thisphase = 0;                                            // Phase change value gets calculated.
+uint8_t thiscutoff = 200;                                     // You can change the cutoff value to display this wave. Lower value = longer wave.
+uint8_t fade = 200;
+bool fadeUp = 0;
+
+void discoTwirl() {
+
+  if (firstTimeRunningThroughPattern) {
+    thishue = 0;                                          // You can change the starting hue value for the first wave.
+    thisrot = 18;                                          // You can change how quickly the hue rotates for this wave. Currently 0.
+    allsat = 180;                                         // I like 'em fully saturated with colour.
+    thisdir = 0;                                             // You can change direction.
+    thisspeed = 8;                                         // You can change the speed, and use negative values.
+    allfreq = 4;                                         // You can change the frequency, thus overall width of bars.
+    thisphase = 0;                                            // Phase change value gets calculated.
+    thiscutoff = 200;                                     // You can change the cutoff value to display this wave. Lower value = longer wave.
+    fade = 200;
+    fadeUp = 1;
+    fadeToBlackBy(leds, NUM_LEDS, 255);
+  } else {
+    EVERY_N_MILLISECONDS(2) {
+      if (fadeUp == 1) fade += 10; else fade -= 10;
+      if (fade < 50) fadeUp = 1; else if (fade > 245) fadeUp = 0;
+    }
+  }
+
+  if (thisdir == 0) thisphase+=thisspeed; else thisphase-=thisspeed;          // You can change direction and speed individually.
+  fadeToBlackBy(leds, NUM_LEDS, fade);
+  for (int k=0; k<NUM_LEDS-1; k++) {
+    int thisbright = cubicwave8((k*-allfreq)+thisphase);      // qsub sets a minimum value called thiscutoff. If < thiscutoff, then bright = 0. Otherwise, bright = 128 (as defined in qsub)..
+    leds[k] += CHSV(thishue + k + thisphase / 5, 200, thisbright);                               // Assigning hues and brightness to the led array.
+  }
+}
+
+void discoTwirl2() {
+
+  if (firstTimeRunningThroughPattern) {
+    thishue = 0;                                          // You can change the starting hue value for the first wave.
+    thisrot = 18;                                          // You can change how quickly the hue rotates for this wave. Currently 0.
+    allsat = 255;                                         // I like 'em fully saturated with colour.u¨
+    thisdir = 0;                                             // You can change direction.
+    thisspeed = 16;                                         // You can change the speed, and use negative values.
+    allfreq = 1;                                         // You can change the frequency, thus overall width of bars.
+    thisphase = 0;                                            // Phase change value gets calculated.
+    thiscutoff = 200;                                     // You can change the cutoff value to display this wave. Lower value = longer wave.
+    fade = 200;
+    fadeUp = 0;
+    thisrot = 0;                                          // You can change how quickly the hue rotates for this wave. Currently 0.
+    allsat = 255;                                         // I like 'em fully saturated with colour.
+    thisdir = 0;                                             // You can change direction.
+    thisspeed = 32;                                         // You can change the speed, and use negative values.
+    allfreq = 32;                                         // You can change the frequency, thus overall width of bars.
+    thisphase = 0;                                            // Phase change value gets calculated.
+    thiscutoff = 200;                                     // You can change the cutoff value to display this wave. Lower value = longer wave.
+  }
+
+  if (thisdir == 0) thisphase+=thisspeed; else thisphase-=thisspeed;          // You can change direction and speed individually.
+  fadeToBlackBy(leds, NUM_LEDS, fade);
+  for (int k=0; k<NUM_LEDS-1; k++) {
+    int thisbright = cubicwave8((k*-allfreq)+thisphase);      // qsub sets a minimum value called thiscutoff. If < thiscutoff, then bright = 0. Otherwise, bright = 128 (as defined in qsub)..
+    leds[k] += CHSV(thishue + k + thisphase / 5, allsat, thisbright);                               // Assigning hues and brightness to the led array.  }
+  }
+}
+
+void loop () {
+  if (!holdPattern) {
+    EVERY_N_MILLISECONDS(rotationInMillseconds) {
+      firstTimeRunningThroughPattern = true;
+      patternId += 1;
+      if (patternId > maxPatternId) {
+        patternId = 1;
+      }
+    }
+  }
+
+  if (patternId == NIGHT_SPARKLES) {
+    nightSparkles();
+  } else if (patternId == BEAUTIFUL_SPARKLES) {
+    beautifulSparkles();
+  // } else if (patternId == SINGLE_COLOR_SPARKLES) {
+  //   sparkles();
+  } else if (patternId == DISCO_BARBER_1 || patternId == DISCO_BARBER_2) {
+    discoBarber();
+  } else if (patternId == WORMS) {
+    worms();
+//  } else if (patternId == PARTY) {
+//    party();
+  } else if (patternId == DISCO_TWIRL) {
+    discoTwirl();
+  } else if (patternId == DISCO_TWIRL_2) {
+    discoTwirl2();
+  } else if (patternId == DAVE) {
+    dave();
+  }
+
+
+  firstTimeRunningThroughPattern = false;
+
+  show_at_max_brightness_for_power();
+  delay(1000/30);
+}


Missed a file.

Missed a file.

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

--- examples/07-Bluetooth/EchoBLE/EchoBLE.ino
+++ examples/07-Bluetooth/EchoBLE/EchoBLE.ino
@@ -0,0 +1,243 @@
+/*
+*	EchoBLE
+*
+*	Created: Ira Ray Jenkins, Creare, July 2020
+*	Purpose: Demonstrates BLE functionality of the Tympan BC127 Bluetooth module. Data
+		received via BLE will be echo'd back.
+*
+*/
+
+#include <Arduino.h>
+
+#include <Tympan_Library.h>
+
+usb_serial_class *USB_Serial;
+HardwareSerial *BT_Serial;
+String response;
+
+void echoIncomingUSBSerial(void)
+{
+    while (USB_Serial->available())
+    {
+        BT_Serial->write(USB_Serial->read());
+    }
+}
+
+void echoIncomingBTSerial(void)
+{
+    while (BT_Serial->available())
+    {
+        USB_Serial->write(BT_Serial->read());
+    }
+}
+
+void readBTResponse(void)
+{
+    response = BT_Serial->readString();
+}
+
+void setup()
+{
+    //  myTympan.beginBothSerial();
+    Serial.begin(9600);
+    Serial1.begin(9600);
+    delay(2000);
+    USB_Serial = &Serial;
+    BT_Serial = &Serial1;
+    USB_Serial->println("*** Setup Starting...");
+
+    BLE_Setup();
+
+    USB_Serial->println("*** Setup Complete.");
+}
+
+void loop()
+{
+    /*
+ while(BT_Serial->available()) {
+    response = BT_Serial->readString();
+
+    USB_Serial->println("Response: " + response.trim());
+
+    if(response.substring(0,8) == "RECV BLE") {
+      USB_Serial->println("*** Received: " + response.substring(9));
+
+      BT_Serial->print("SEND Received: " + response.substring(9) + "\r");
+
+      delay(200);
+
+      BT_Serial->readString();
+
+    }
+  }
+  */
+
+    echoIncomingUSBSerial();
+    echoIncomingBTSerial();
+}
+
+void BLE_Setup(void)
+{
+    BC127 ble = BC127(&Serial1);
+
+    BC127::opResult res;
+
+    Serial1.print("$");
+    delay(400);
+    Serial1.print("$$$");
+    delay(2400);
+
+    // get version
+    USB_Serial->println("*** BC127 Version");
+    res = ble.version();
+
+    if (res == BC127::TIMEOUT_ERROR)
+    {
+        USB_Serial->println("timeout error");
+    }
+    else if (res == BC127::MODULE_ERROR)
+    {
+        USB_Serial->println("Module error");
+    }
+    else
+    {
+        USB_Serial->println("SUCCESS!\n" + ble.getCmdResponse());
+    }
+
+    USB_Serial->println("*** Configuration");
+    res = ble.getConfig();
+    if (res == BC127::TIMEOUT_ERROR)
+    {
+        USB_Serial->println("timeout error");
+    }
+    else if (res == BC127::MODULE_ERROR)
+    {
+        USB_Serial->println("module error");
+    }
+    else
+    {
+        USB_Serial->println("SUCCESS!\n" + ble.getCmdResponse());
+    }
+
+    USB_Serial->println("*** RSSI_THRESH Config");
+    res = ble.getConfig("RSSI_THRESH");
+    if (res == BC127::TIMEOUT_ERROR)
+    {
+        USB_Serial->println("timeout error");
+    }
+    else if (res == BC127::MODULE_ERROR)
+    {
+        USB_Serial->println("module error");
+    }
+    else
+    {
+        USB_Serial->println("SUCCESS!\n" + ble.getCmdResponse());
+    }
+
+    // restore factory defaults
+    USB_Serial->println("*** Restoring factory defaults...");
+    res = ble.restore();
+    if (res == BC127::TIMEOUT_ERROR)
+    {
+        USB_Serial->println("timeout error");
+    }
+    else if (res == BC127::MODULE_ERROR)
+    {
+        USB_Serial->println("module error");
+    }
+    else
+    {
+        USB_Serial->println("SUCCESS!\n" + ble.getCmdResponse());
+    }
+
+    USB_Serial->println("*** Writing config...");
+    res = ble.writeConfig();
+    if (res == BC127::TIMEOUT_ERROR)
+    {
+        USB_Serial->println("timeout error");
+    }
+    else if (res == BC127::MODULE_ERROR)
+    {
+        USB_Serial->println("module error");
+    }
+    else
+    {
+        USB_Serial->println("SUCCESS!\n" + ble.getCmdResponse());
+    }
+
+    USB_Serial->println("*** Reset device...");
+    res = ble.reset();
+    if (res == BC127::TIMEOUT_ERROR)
+    {
+        USB_Serial->println("timeout error");
+    }
+    else if (res == BC127::MODULE_ERROR)
+    {
+        USB_Serial->println("module error");
+    }
+    else
+    {
+        USB_Serial->println("SUCCESS!\n" + ble.getCmdResponse());
+    }
+
+    USB_Serial->println("*** Enable ANDROID BLE...");
+    res = ble.setConfig("ENABLE_ANDROID_BLE", "ON");
+    if (res == BC127::TIMEOUT_ERROR)
+    {
+        USB_Serial->println("timeout error");
+    }
+    else if (res == BC127::MODULE_ERROR)
+    {
+        USB_Serial->println("module error");
+    }
+    else
+    {
+        USB_Serial->println("SUCCESS!\n" + ble.getCmdResponse());
+    }
+
+    // set advertising
+    USB_Serial->println("*** Set advertising on...");
+    res = ble.advertise();
+    if (res == BC127::TIMEOUT_ERROR)
+    {
+        USB_Serial->println("timeout error");
+    }
+    else if (res == BC127::MODULE_ERROR)
+    {
+        USB_Serial->println("module error");
+    }
+    else
+    {
+        USB_Serial->println("SUCCESS!\n" + ble.getCmdResponse());
+    }
+
+    while (1)
+    {
+        if (BT_Serial->available())
+        {
+            readBTResponse();
+            USB_Serial->print("*** Response = ");
+            USB_Serial->println(response);
+            response.trim();
+
+            if (response.equalsIgnoreCase("OPEN_OK BLE"))
+            //if (response.indexOf("OPEN_OK BLE") > 0)
+            {
+                USB_Serial->println("*** Connected.");
+                break;
+            }
+            delay(2000);
+        }
+    }
+
+    USB_Serial->println("*** BLE Connected.");
+
+    if (!ble.stdCmd("HELP"))
+    {
+        USB_Serial->println("error");
+    }
+    else
+    {
+        USB_Serial->println(ble.getCmdResponse());
+    }
+}


added ESO8266 example

added ESO8266 example

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

--- examples/ESP8266/ESP8266.ino
+++ examples/ESP8266/ESP8266.ino
@@ -0,0 +1,49 @@
+#include <SPI.h>
+#include <KTask.h>
+
+#define LEDPIN LED_BUILTIN
+
+bool ledOn = false;
+void blink() {
+    if (ledOn) {
+        digitalWrite(LEDPIN, LOW);
+        Serial.println("on");
+        ledOn = false;
+    } else {
+        digitalWrite(LEDPIN, HIGH);
+        Serial.println("off");
+        ledOn = true;
+    }
+}
+
+KTask blinker(500, blink);
+
+void setup() {
+    Serial.begin(74880);
+    pinMode(LEDPIN, OUTPUT);
+    Serial.println("starting");
+    KTask::setup();
+}
+
+void loop() {
+    KTask::loop();
+}
+
+//#define LED LED_BUILTIN
+//
+//// the setup function runs once when you press reset or power the board
+//void setup() {
+//    // initialize digital pin 13 as an output.
+//    Serial.begin(74880);
+//    pinMode(LED, OUTPUT);
+//}
+//
+//// the loop function runs over and over again forever
+//void loop() {
+//    digitalWrite(LED, HIGH);   // turn the LED on (HIGH is the voltage level)
+//    Serial.println("off");
+//    delay(1000);              // wait for a second
+//    digitalWrite(LED, LOW);    // turn the LED off by making the voltage LOW
+//    Serial.println("on");
+//    delay(1000);              // wait for a second
+//}