Add ArduCAM 2MP video streaming example

Add ArduCAM 2MP video streaming example

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

--- ArduCAM/examples/mini/ArduCAM_Mini_OV2640_Video_Streaming/ArduCAM_Mini_OV2640_Video_Streaming.ino
+++ ArduCAM/examples/mini/ArduCAM_Mini_OV2640_Video_Streaming/ArduCAM_Mini_OV2640_Video_Streaming.ino
@@ -0,0 +1,315 @@
+// ArduCAM Mini demo (C)2015 Lee
+// web: http://www.ArduCAM.com
+// This program is a demo of how to use most of the functions
+// of the library with ArduCAM Mini 2MP camera, and can run on any Arduino platform.
+//
+// This demo was made for ArduCAM Mini OV2640 2MP Camera.
+// It needs to be used in combination with PC software.
+// It can take photo continuously as video streaming.
+//
+// The demo sketch will do the following tasks:
+// 1. Set the camera to JEPG output mode.
+// 2. Read data from Serial port and deal with it
+// 3. If receive 0x00-0x08,the resolution will be changed.
+// 4. If receive 0x10,camera will capture a JPEG photo and buffer the image to FIFO.Then write datas to Serial port.
+// 5. If receive 0x20,camera will capture JPEG photo and write datas continuously.Stop when receive 0x21.
+// 6. If receive 0x30,camera will capture a BMP  photo and buffer the image to FIFO.Then write datas to Serial port.
+// 7. If receive 0x11 ,set camera to JPEG output mode.
+// 8. If receive 0x31 ,set camera to BMP  output mode.
+// This program requires the ArduCAM V3.4.1 (or later) library and ArduCAM Mini 2MP camera
+// and use Arduino IDE 1.5.8 compiler or above
+
+#include <Wire.h>
+#include <ArduCAM.h>
+#include <SPI.h>
+#include "memorysaver.h"
+
+#define BMPIMAGEOFFSET 66
+
+// set pin 10 as the slave select for the digital pot:
+const int CS = 10;
+int mode = 0;
+
+const char bmp_header[BMPIMAGEOFFSET] PROGMEM =
+{
+  0x42, 0x4D, 0x36, 0x58, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x28, 0x00,
+  0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x03, 0x00,
+  0x00, 0x00, 0x00, 0x58, 0x02, 0x00, 0xC4, 0x0E, 0x00, 0x00, 0xC4, 0x0E, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0x1F, 0x00,
+  0x00, 0x00
+};
+
+ArduCAM myCAM(OV2640, CS);
+
+void setup() {
+  // put your setup code here, to run once:
+  uint8_t vid, pid;
+  uint8_t temp;
+#if defined (__AVR__)
+  Wire.begin();
+#endif
+#if defined(__arm__)
+  Wire1.begin();
+#endif
+  Serial.begin(921600);
+  Serial.println("ArduCAM Start!");
+
+  // set the CS as an output:
+  pinMode(CS, OUTPUT);
+
+  // initialize SPI:
+  SPI.begin();
+
+  //Check if the ArduCAM SPI bus is OK
+  myCAM.write_reg(ARDUCHIP_TEST1, 0x55);
+  temp = myCAM.read_reg(ARDUCHIP_TEST1);
+  //Serial.println(temp);
+  if (temp != 0x55)
+  {
+    Serial.println("SPI1 interface Error!");
+    //while(1);
+  }
+
+  //Check if the camera module type is OV2640
+  myCAM.wrSensorReg8_8(0xff, 0x01);
+  myCAM.rdSensorReg8_8(OV2640_CHIPID_HIGH, &vid);
+  myCAM.rdSensorReg8_8(OV2640_CHIPID_LOW, &pid);
+  if ((vid != 0x26) || (pid != 0x42))
+    Serial.println("Can't find OV2640 module!");
+  else
+    Serial.println("OV2640 detected.");
+
+  //Change to JPEG capture mode and initialize the OV2640 module
+  myCAM.set_format(JPEG);
+  myCAM.InitCAM();
+  myCAM.OV2640_set_JPEG_size(OV2640_320x240);
+  myCAM.clear_fifo_flag();
+  myCAM.write_reg(ARDUCHIP_FRAMES, 0x00);
+}
+
+void loop() {
+  // put your main code here, to run repeatedly:
+  uint8_t temp, temp_last;
+  uint8_t start_capture = 0;
+  bool is_header = false;
+  if (Serial.available())
+  {
+    temp = Serial.read();
+    switch (temp)
+    {
+      case 0:
+        myCAM.OV2640_set_JPEG_size(OV2640_160x120);
+        break;
+      case 1:
+        myCAM.OV2640_set_JPEG_size(OV2640_176x144);
+        break;
+      case 2:
+        myCAM.OV2640_set_JPEG_size(OV2640_320x240);
+        break;
+      case 3:
+        myCAM.OV2640_set_JPEG_size(OV2640_352x288);
+        break;
+      case 4:
+        myCAM.OV2640_set_JPEG_size(OV2640_640x480);
+        break;
+      case 5:
+        myCAM.OV2640_set_JPEG_size(OV2640_800x600);
+        break;
+      case 6:
+        myCAM.OV2640_set_JPEG_size(OV2640_1024x768);
+        break;
+      case 7:
+        myCAM.OV2640_set_JPEG_size(OV2640_1280x1024);
+        break;
+      case 8:
+        myCAM.OV2640_set_JPEG_size(OV2640_1600x1200);
+        break;
+
+      case 0x10:
+        mode = 1;
+        start_capture = 1;
+        Serial.println("CAM start single shoot.");
+        break;
+      case 0x11:
+        myCAM.set_format(JPEG);
+        myCAM.InitCAM();
+        break;
+      case 0x20:
+        mode = 2;
+        start_capture = 2;
+        Serial.println("CAM start contrues shoots.");
+        break;
+      case 0x30:
+        mode = 3;
+        start_capture = 3;
+        Serial.println("CAM start single shoot.");
+        break;
+      case 0x31:
+        myCAM.set_format(BMP);
+        myCAM.InitCAM();
+        break;
+      default:
+        break;
+    }
+  }
+  if (mode == 1)
+  {
+    if (start_capture == 1)
+    {
+      myCAM.flush_fifo();
+      myCAM.clear_fifo_flag();
+      myCAM.start_capture();
+      start_capture = 0;
+    }
+    if (myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK))
+    {
+      Serial.println("CAM Capture Done!");
+      read_fifo_burst(myCAM);
+      //Clear the capture done flag
+      myCAM.clear_fifo_flag();
+    }
+  }
+  else if (mode == 2)
+  {
+    while (1)
+    {
+      temp = Serial.read();
+      if (temp == 0x21)
+      {
+        start_capture = 0;
+        mode = 0;
+        Serial.println("CAM stop continuous shoots!");
+        break;
+      }
+      if (start_capture == 2)
+      {
+        myCAM.flush_fifo();
+        myCAM.clear_fifo_flag();
+        //Start capture
+        myCAM.start_capture();
+        start_capture = 0;
+      }
+      if (myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK))
+      {
+        uint32_t length = myCAM.read_fifo_length();
+        if ((length >= 393216) | (length == 0))
+        {
+          myCAM.clear_fifo_flag();
+          start_capture = 2;
+          continue;
+        }
+        myCAM.CS_LOW();
+        myCAM.set_fifo_burst();//Set fifo burst mode
+        //SPI.transfer(0x00);
+        length--;
+        while ( length-- )
+        {
+          temp_last = temp;
+          temp =  SPI.transfer(0x00);
+          Serial.write(temp);
+          if ( (temp == 0xD9) && (temp_last == 0xFF) ) //If find the end ,break while,
+            break;
+          delayMicroseconds(12);
+        }
+        myCAM.CS_HIGH();
+        myCAM.clear_fifo_flag();
+        start_capture = 2;
+      }
+    }
+  }
+  else if (mode == 3)
+  {
+    if (start_capture == 3)
+    {
+      //Flush the FIFO
+      myCAM.flush_fifo();
+      myCAM.clear_fifo_flag();
+      //Start capture
+      myCAM.start_capture();
+      start_capture = 0;
+    }
+    if (myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK))
+    {
+      Serial.println("CAM Capture Done!");
+
+      uint8_t temp, temp_last;
+      uint32_t length = 0;
+      length = myCAM.read_fifo_length();
+      if (length >= 393216 ) // 384kb
+      {
+        Serial.println("Over size.");
+        myCAM.clear_fifo_flag();
+        return;
+      }
+
+      if (length == 0 ) //0 kb
+      {
+        Serial.println("Size is 0.");
+        myCAM.clear_fifo_flag();
+        return;
+      }
+      myCAM.CS_LOW();
+      myCAM.set_fifo_burst();//Set fifo burst mode
+
+      Serial.write(0xFF);
+      Serial.write(0xAA);
+      for (temp = 0; temp < BMPIMAGEOFFSET; temp++)
+      {
+        Serial.write(pgm_read_byte(&bmp_header[temp]));
+      }
+      SPI.transfer(0x00);
+
+      char VH, VL;
+      int i = 0, j = 0;
+      for (i = 0; i < 240; i++)
+      {
+        for (j = 0; j < 320; j++)
+        {
+          VH = SPI.transfer(0x00);;
+          VL = SPI.transfer(0x00);;
+          Serial.write(VL);
+          delayMicroseconds(12);
+          Serial.write(VH);
+          delayMicroseconds(12);
+        }
+      }
+      Serial.write(0xBB);
+      Serial.write(0xCC);
+
+      myCAM.CS_HIGH();
+      //Clear the capture done flag
+      myCAM.clear_fifo_flag();
+    }
+  }
+}
+
+void read_fifo_burst(ArduCAM myCAM)
+{
+  uint8_t temp, temp_last;
+  uint32_t length = 0;
+  length = myCAM.read_fifo_length();
+  if (length >= 393216 ) // 384kb
+  {
+    Serial.println("Over size.");
+    return;
+  }
+  if (length == 0 ) //0 kb
+  {
+    Serial.println("Size is 0.");
+    return;
+  }
+  myCAM.CS_LOW();
+  myCAM.set_fifo_burst();//Set fifo burst mode
+  //SPI.transfer(0x00);
+  length--;
+  while ( length-- )
+  {
+    temp_last = temp;
+    temp =  SPI.transfer(0x00);//read a byte from spi
+    Serial.write(temp);
+    if ( (temp == 0xD9) && (temp_last == 0xFF) ) //If find the end ,break while,
+      break;
+    delayMicroseconds(12);
+  }
+  myCAM.CS_HIGH();
+}


Create connect4.ino

Create connect4.ino

Arduino sketch for Barnsley.IO connect4 project

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

--- connect4.ino
+++ connect4.ino
@@ -0,0 +1,189 @@
+// Connect 4
+// P Beard
+// Jan 2015
+
+// Used as array of bits for positions of "X" tokens
+unsigned long long boardO;
+// Used as array of bits for positions of "O" tokens
+unsigned long long boardX;
+
+// Array containing start position of each "win line"
+byte lineStart[] = { 0,  7, 14, 21, 28, 35,  0,  1,  2,  3,  4,  5,  6, 14,  7,  0,  1,  2,  3,  3,  4,  5,  6, 13, 20};
+// Array containing number of groups of 4 positions on each "win line"
+byte lineReps[] =  { 4,  4,  4,  4,  4,  4,  3,  3,  3,  3,  3,  3,  3,  1,  2,  3,  3,  2,  1,  1,  2,  3,  3,  2,  1};
+// Array containing direction offset for each "win line"
+byte lineSteps[] = { 1,  1,  1,  1,  1,  1,  7,  7,  7,  7,  7,  7,  7,  7,  8,  8,  8,  8,  8,  6,  6,  6,  6,  6,  6};
+
+void setup() {
+  Serial.begin(9600);
+  Serial.println();
+  Serial.println("~~~~~~Connect 4~~~~~~");
+  Serial.println();
+  displayBoard(boardO, boardX);
+}
+
+void loop() {
+  char c;
+  byte best;
+  int currentScore;
+
+  Serial.println();
+  Serial.print("Your go:");
+  while (Serial.available() < 1) {} // wait for key code
+  c = Serial.read();
+  Serial.println(c);
+  Serial.println();
+  while (Serial.available() < 1) {} // wait for CR code
+  Serial.read(); // discard CR code
+  dropCounter(boardX, boardO, c - '0');
+  displayBoard(boardO, boardX);
+
+  if (score(boardO, boardX) < -500) {
+    Serial.println();
+    Serial.println ("****CONGRATULATIONS YOU WIN****");
+    Serial.println();
+    Serial.println("Press reset for new game");
+    while (true) {}
+  }
+  else {
+
+    Serial.println();
+    Serial.print("My go:");
+    currentScore = bestMove(boardO, boardX, best, 3);
+    Serial.println(best);
+    Serial.println();
+    dropCounter(boardO, boardX, best);
+    displayBoard(boardO, boardX);
+
+    if (score(boardO, boardX) > 500) {
+      Serial.println();
+      Serial.println ("****COMISERATIONS YOU LOST****");
+      Serial.println();
+      Serial.println("Press reset for new game");
+      while (true) {}
+    }
+  }
+}
+
+void displayBoard(unsigned long long boardO, unsigned long long boardX) {
+
+  unsigned long long mask = 1ULL;
+
+  for(byte col = 0; col <= 6; col++) Serial.print(col);
+  Serial.println();
+
+  for(byte row = 0; row <= 5; row++) {
+    for(byte col = 0; col <= 6; col++) {
+      if (boardO & mask) Serial.print('O');
+      else if (boardX & mask) Serial.print('X');
+      else Serial.print('.');
+      mask = mask << 1;
+    }
+    Serial.println();
+  }
+}
+
+void dropCounter(unsigned long long &boardO, unsigned long long &boardX, byte col) {
+
+  unsigned long long mask = 1ULL << col;
+  byte row = 0;
+
+  while (row < 5) {
+    // Test if the position one row down is empty
+    unsigned long long mask2 = mask << 7;
+    if (((boardO | boardX) & mask2)) break;
+    // Move down a row
+    row++;
+    mask = mask2;
+  }
+  // Place the token here
+  boardO |= mask;
+}
+
+int score(unsigned long long &boardO, unsigned long long &boardX) {
+
+  int totalScore = 0;
+
+  // Scan each "win" line on the board
+  for (byte line = 0; line < 25; line++) {
+
+    unsigned long long mask = 1ULL << lineStart[line];
+    byte lineStep = lineSteps[line];
+
+    // Scan each group of 4 positions on the "win" line
+    for (byte rep = 0; rep < lineReps[line]; rep++) {
+
+      unsigned long long mask2 = mask;
+      int addScore = 0;
+
+      // Check this group of 4 positions
+      for (byte pos = 0; pos < 4; pos++) {
+
+        if (boardO & mask2) {
+          if (addScore < 0) {
+            // A mix of "O" and "X" - no-one can win here
+            addScore = 0;
+            break;
+          }
+          else if (addScore == 0) addScore = 1;
+          else if (addScore == 1) addScore = 10;
+          else if (addScore == 10) addScore = 100;
+          else if (addScore == 100) addScore = 1000;
+        }
+
+        if (boardX & mask2) {
+          if (addScore > 0) {
+            // A mix of "O" and "X" - no-one can win here
+            addScore = 0;
+            break;
+          }
+          else if (addScore == 0) addScore = -1;
+          else if (addScore == -1) addScore = -10;
+          else if (addScore == -10) addScore = -100;
+          else if (addScore == -100) addScore = -1000;
+        }
+        // Move to next position in group of 4
+        mask2 = mask2 << lineStep;
+      }
+      // Move to next start position of next group-of-4 on the win line
+      mask = mask << lineStep;
+      // Add any score to the total score for the board
+      totalScore += addScore;
+    }
+  }
+
+  return totalScore;
+}
+
+int bestMove(unsigned long long &boardO, unsigned long long &boardX, byte &best, byte lookAhead) {
+
+  int bestScore = -9999;
+  byte best2;
+
+  // Evaluate each choice of column
+  for (byte col = 0; col < 7; col++) {
+
+    // Make a copy of the board
+    unsigned long long boardOcopy = boardO;
+    unsigned long long boardXcopy = boardX;
+    int thisScore;
+    // Drop token onto the copy of the board
+    dropCounter(boardOcopy, boardXcopy, col);
+
+    if (lookAhead == 0)
+      // Don't look any more moves ahead, just evaluate the board as-is
+      thisScore = score(boardOcopy, boardXcopy);
+    else
+      // Look more moves ahead, but swap places with opponent since it will be their turn next
+      thisScore = -bestMove(boardXcopy, boardOcopy, best2, lookAhead - 1);
+
+    // Check this choice of column - best so far?
+    if (thisScore > bestScore) {
+      // Yes, a new best choice found
+      bestScore = thisScore;
+      best = col;
+    }
+  }
+  return bestScore;
+}
+


Use different why of measure

Use different why of measure

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


Main dumping program uploaded

Main dumping program uploaded

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

--- EPROM_Dumper.ino
+++ EPROM_Dumper.ino
@@ -0,0 +1,54 @@
+
+#define MAX_ADDR 4096 //Take 2 to the power of the number of address lines
+
+void setup()
+{
+   Serial.begin(9600); // Opens Serial Port to receive data
+
+   DDRL = B00000000;  //Sets up L-pins as 8-bit input A + C as 16 bit output
+   DDRA = B11111111;  //Lower address
+   DDRC = B11111111;  //Upper address
+
+   PORTA = B00000000; //Sets output data on pin register A as 0
+   PORTC = B00000000; //Sets output data on pin register C as 0
+
+}
+
+void loop()
+{
+
+ uint16_t i;
+
+ for(i = 0; i <= (MAX_ADDR - 1); ++i)
+ {
+    PORTA = i & 0xff;
+    PORTC = (i >> 8) & 0xff;
+
+    print_data(1);
+ }
+
+ delay(500);
+ exit(0);
+
+}
+
+void print_data(bool full_data)
+{
+
+  if(full_data)
+  {
+    Serial.print(PINL, HEX);
+    Serial.print(" ");
+    Serial.print(PORTC, BIN);
+    Serial.print(" ");
+    Serial.print(PORTA, BIN);
+    Serial.print("\n");
+
+  }
+  else
+  {
+    Serial.print(PINF, HEX);
+    Serial.print(" ");
+  }
+}
+


Fixed wind speed!

Fixed wind speed!

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


Pince: maj i2c

Pince: maj i2c

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


Create tempsensor.ino

Create tempsensor.ino

error: pathspec 'laddstation/sub-module/tempsensor.ino' did not match any file(s) known to git

--- laddstation/sub-module/tempsensor.ino
+++ laddstation/sub-module/tempsensor.ino
@@ -0,0 +1,38 @@
+#include <OneWire.h>
+#include <DallasTemperature.h>
+
+// Data wire is plugged into pin 2 on the Arduino
+#define ONE_WIRE_BUS 2
+
+// Setup a oneWire instance to communicate with any OneWire devices
+// (not just Maxim/Dallas temperature ICs)
+OneWire oneWire(ONE_WIRE_BUS);
+
+// Pass our oneWire reference to Dallas Temperature.
+DallasTemperature sensors(&oneWire);
+
+void setup(void)
+{
+  // start serial port
+  Serial.begin(9600);
+  Serial.println("Dallas Temperature IC Control Library Demo");
+
+  // Start up the library
+  sensors.begin();
+}
+
+
+void loop(void)
+{
+  // call sensors.requestTemperatures() to issue a global temperature
+  // request to all devices on the bus
+  Serial.print(" Requesting temperatures...");
+  sensors.requestTemperatures(); // Send the command to get temperatures
+  Serial.println("DONE");
+
+  Serial.print("Temperature is: ");
+  Serial.print(sensors.getTempCByIndex(0)); // Why "byIndex"?
+    // You can have more than one IC on the same bus.
+    // 0 refers to the first IC on the wire
+    delay(1000);
+}


simple-servo

simple-servo

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

--- simple_servo/simple_servo.ino
+++ simple_servo/simple_servo.ino
@@ -0,0 +1,63 @@
+
+#include <Servo.h>
+
+Servo servosg90;
+int ledPingruen = 13;
+int ledPinrot = 12;
+
+//button
+int inPin = 7;   // pushbutton connected to digital pin 7
+int val = 0;     // variable to store the read value
+//button end
+
+void setup()
+
+{
+pinMode(ledPingruen, OUTPUT);
+pinMode(ledPinrot, OUTPUT);
+
+servosg90.attach(8);
+
+
+//button
+ pinMode(inPin, INPUT_PULLUP);      // sets the digital pin 7 as input
+
+  Serial.begin(9600);
+//button end
+
+
+}
+
+
+void loop()
+
+{
+  //button
+  val = digitalRead(inPin);   // read the input pin
+  //digitalWrite(ledPin, val);
+
+  Serial.println(val);             // debug value
+  delay(100);
+  //button end
+
+
+
+  digitalWrite(ledPingruen, 1);
+
+
+  if(val==0){
+
+  digitalWrite(ledPingruen, 0);
+  digitalWrite(ledPinrot, 1);
+  servosg90.write(0);
+
+  delay(500);
+
+  servosg90.write(120);
+
+
+  delay(500);
+  digitalWrite(ledPinrot, 0);
+  digitalWrite(ledPingruen, 1);
+
+}}


Added example for cpu, memory, uptime and voltage of Edison sent to Iotkit Cloud.

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

--- arduino/IoTkit/examples/IotKitSendMetricsExample/IotKitSendMetricsExample.ino
+++ arduino/IoTkit/examples/IotKitSendMetricsExample/IotKitSendMetricsExample.ino
@@ -0,0 +1,117 @@
+//This example reads the cpu load, memory usage, voltage and uptime on Edison board
+//and sends the data to the Intel IoTkit Cloud
+//It also sends 1 as power when agent is started.
+
+#include <IoTkit.h>    // include IoTkit.h to use the Intel IoT Kit
+#include <Ethernet.h>  // must be included to use IoTkit
+#include <aJSON.h>
+#include <stdio.h>
+
+// create an object of the IoTkit class
+IoTkit iotkit;
+int temp;
+char buf[112];
+
+void setup() {
+  Serial.begin(115200);
+  // call begin on the IoTkit object before calling any other methods
+  iotkit.begin();
+  delay(10500);
+  iotkit.send("power", 1);
+}
+
+void sendUptime(){
+  FILE *lsofFile_p = popen("uptime | awk '{gsub(/:/,\"\"); print $1}'", "r");
+
+  if (lsofFile_p)
+  {
+    char buffer[1024];
+    char *line_p = fgets(buffer, sizeof(buffer), lsofFile_p);
+
+    Serial.print("uptime:");
+    Serial.println(buffer);
+    iotkit.send("uptime", atof(buffer));
+  }
+  pclose(lsofFile_p);
+}
+
+void sendProc(){
+  FILE *lsofFile_p = popen("grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage }'", "r");
+
+  if (lsofFile_p)
+  {
+    char buffer[1024];
+    char *line_p = fgets(buffer, sizeof(buffer), lsofFile_p);
+
+    Serial.print("Cpu:");
+    Serial.println(buffer);
+    iotkit.send("cpu_proc", atof(buffer));
+  }
+  pclose(lsofFile_p);
+}
+
+void sendMem(){
+
+  FILE *lsofFile_p = popen(" free | awk 'FNR == 3 {print $3/($3+$4)*100}'", "r");
+
+  if (lsofFile_p)
+  {
+    char buffer[1024];
+    char *line_p = fgets(buffer, sizeof(buffer), lsofFile_p);
+
+    Serial.print("Mem:");
+    Serial.println(buffer);
+    iotkit.send("mem_proc",atof(buffer));
+  }
+  pclose(lsofFile_p);
+}
+
+void logDevice(){
+  system("top -n 1 | grep 'CPU\|Mem' | head -n 2 >> /home/root/logagent.log");
+  system("top -n 1 | grep 'iot\|sket' | head -n 2 >> /home/root/logagent.log");
+  system("curl -ILs 'http://www.google.com' | head -n 1  >> /home/root/logagent.log");
+  system("uptime >> /home/root/logagent.log");
+}
+
+void loop() {
+  int voltage=getVolt();
+  Serial.println("Voltage is: ");
+  Serial.print(voltage);
+  Serial.println(".");
+
+  iotkit.send("voltage", voltage);
+  sendProc();
+  sendMem();
+  sendUptime();
+
+  delay(5000);
+}
+
+// reads hardware temp sensor
+int getVolt(){
+  char scale[4];
+  char raw[4];
+  char offset[4];
+
+  int raw_i;
+  int scale_i;
+  int offset_i;
+
+  FILE *fp_raw;
+  fp_raw = fopen("/sys/bus/iio/devices/iio:device1/in_voltage0_raw", "r");  //read the values from scale, raw and offset files.
+  fgets(raw, 4, fp_raw);                                                    //we need all three values, because the formula for
+  fclose(fp_raw);                                                           //calulating the actual temperature in milli-degrees Celcius
+                                                                            //is: TEMP = (RAW + OFFSET) * SCALE
+  FILE *fp_scale;
+  fp_scale = fopen("/sys/bus/iio/devices/iio:device1/in_voltage_scale", "r");
+  fgets(scale, 4, fp_scale);
+  fclose(fp_scale);
+
+  raw_i = atoi(raw);         //we have the values now, but they are in ASCII form-
+  scale_i = atoi(scale);     //we need them as integers so we can use them for calculations.
+  //offset_i = atoi(offset);
+
+  float temp = raw_i  * scale_i;  //Calculate temperature in milli-degrees celcius
+                                  //divide by 1000 to convert to degrees celcius
+  return temp;
+}


Start soil source

Start soil source

Need to calibrate this one

error: pathspec 'real-devices/Arduino/ESP8266/sources/soil-source/soil-source.ino' did not match any file(s) known to git

--- real-devices/Arduino/ESP8266/sources/soil-source/soil-source.ino
+++ real-devices/Arduino/ESP8266/sources/soil-source/soil-source.ino
@@ -0,0 +1,74 @@
+/*
+   IoT Dataflow Graph Server
+   Copyright (c) 2015, Adam Rehn, Jason Holdsworth
+                 2018, Wilson Bow
+
+  Permission is hereby granted, free of charge, to any person obtaining a copy
+  of this software and associated documentation files (the "Software"), to deal
+  in the Software without restriction, including without limitation the rights
+  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+  copies of the Software, and to permit persons to whom the Software is
+  furnished to do so, subject to the following conditions:
+
+  The above copyright notice and this permission notice shall be included in all
+  copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+  SOFTWARE.
+*/
+
+#include <ESP8266WiFi.h>
+#include <WiFiUDP.h>
+#include <ESP8266MulticastUDP.h>
+
+//The identifier for this node
+const String& NODE_IDENTIFIER = "soil-source";
+
+//The interval (in milliseconds) at which input is read
+#define READ_INTERVAL 100
+
+// Setup the ESP8266 Multicast UDP object as a source
+ESP8266MulticastUDP multicast("iot-dataflow", "it-at-jcu",
+  IPAddress(224, 0, 0, 114), 7070);
+
+
+#define ERROR_PIN 15
+#define INPUT_PIN A0
+
+void setup()
+{
+  //Initialise serial communications
+  Serial.begin(115200);
+
+  pinMode(INPUT_PIN, INPUT);
+
+  multicast.begin();
+  Serial.print(NODE_IDENTIFIER);
+  if (multicast.isConnected()) {
+    Serial.println(" connected to Wifi network");
+  } else {
+    Serial.println(" error: failed to connect to WiFi network!");
+    pinMode(ERROR_PIN, OUTPUT);
+    digitalWrite(ERROR_PIN, HIGH);
+  }
+}
+
+int readSource() {
+  int rawValue = analogRead(INPUT_PIN);
+  return rawValue;
+}
+
+void loop()
+{
+  if (multicast.isConnected())
+  {
+    String message = String(NODE_IDENTIFIER) + "\n" + readSource();
+    multicast.write(message);
+    delay(READ_INTERVAL);
+  }
+}


Fixed Wifi example

Fixed Wifi example

--- libraries/WiFi/examples/WifiWebServer/WifiWebServer.ino
+++ libraries/WiFi/examples/WifiWebServer/WifiWebServer.ino
@@ -1,5 +1,5 @@
 /*
-  Web  Server
+  WiFi Web Server

  A simple web server that shows the value of the analog input pins.
  using a WiFi shield.
@@ -15,7 +15,9 @@
  by dlf (Metodo2 srl)
  modified 31 May 2012
  by Tom Igoe
+
  */
+
 #include <SPI.h>
 #include <WiFi.h>

@@ -76,7 +78,7 @@
           // send a standard http response header
           client.println("HTTP/1.1 200 OK");
           client.println("Content-Type: text/html");
-          client.println("Connnection: close");
+          client.println("Connection: close");
           client.println();
           client.println("<!DOCTYPE HTML>");
           client.println("<html>");


Create toggle_pixels_off_with_button.ino

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

--- toggle_pixels_off_with_button.ino
+++ toggle_pixels_off_with_button.ino
@@ -0,0 +1,99 @@
+//***************************************************************
+// Example to turn some pixels virtual "off" with a button.
+// Pixels are still powered and reciving data, but are simply
+// set to display black when "off".
+//
+// This example is for a 32 pixel strip.  Pressing the button
+// turns "off" the last 8 pixels.  The pixel number where the
+// cutoff starts is determined in the for loop on line 93.
+//
+// This is how the button is wired for this example:
+// http://i.imgur.com/hOgQwjX.jpg
+//
+// Instead of a momentary button a switch could be used and
+// the controller could directly read the input pin as high
+// or low.  The button library would not be needed in this case.
+//
+// Marc Miller, Oct 2017
+//***************************************************************
+
+
+//---------------------------------------------------------------
+// This sketch uses JChristensen's Button Library from:
+//   https://github.com/JChristensen/Button
+//
+#include "Button.h"    // Include the Button library
+
+// Set the digital pin for the pushbutton, and declare the button
+const uint8_t ButtonPin = 4;
+Button OnOff_Button(ButtonPin, true, true, 100);
+
+
+//---------------------------------------------------------------
+#include "FastLED.h"
+#define DATA_PIN    11
+#define CLK_PIN   13
+#define LED_TYPE    LPD8806
+#define COLOR_ORDER GRB
+#define NUM_LEDS    32
+CRGB leds[NUM_LEDS];
+#define BRIGHTNESS 128
+
+boolean OnOff_Status = 1;  // Status of extra pixels.  [1=On, 0=Off]
+
+
+//---------------------------------------------------------------
+void setup() {
+  Serial.begin(115200);  // Allows serial monitor output (check baud rate)
+  delay(1500); // short delay for recovery
+  //FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
+  FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
+  FastLED.setBrightness(BRIGHTNESS);
+  FastLED.clear();
+}
+
+
+//---------------------------------------------------------------
+void loop()
+{
+  readbutton();  // check the button to see if it's been pressed
+
+  fill_rainbow( leds, NUM_LEDS, millis()/20 );
+
+
+  extraLeds_OnOff();  // always run right before FastLED.show()
+  FastLED.show();  // display the pixels
+
+}//end_main_loop
+
+
+
+
+//---------------------------------------------------------------
+// Functions
+
+//---------------------------------------------------------------
+//Check the button and set the appropriate flag
+void readbutton() {
+  OnOff_Button.read();  // check the state of the button
+
+  if(OnOff_Button.wasPressed()) {
+    OnOff_Status = !OnOff_Status;
+    Serial.print("OnOff_Status: "); Serial.println(OnOff_Status);
+  }
+
+}//end_readbutton
+
+
+//---------------------------------------------------------------
+// Turn extra pixels on or off
+void extraLeds_OnOff(){
+
+  if (OnOff_Status ==0) {
+    for (uint8_t i=24; i < NUM_LEDS; i++) {  //i=24 is the first pixel in the extras to be turned off.
+     leds[i] = CRGB::Black;  // turn "off"
+    }
+  }
+
+}//end_extraLeds_OnOff
+


added sensor 3-axis detection

added sensor 3-axis detection

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

--- Arduino/TripleAxis/TripleAxis.ino
+++ Arduino/TripleAxis/TripleAxis.ino
@@ -0,0 +1,63 @@
+/**
+ * HACKWAW #3
+ * FluAlert
+ * @author Szymon P. Peplinski
+ */
+
+// Reference the I2C Library
+#include <Wire.h>
+
+// Reference the HMC5883L Compass Library
+#include <HMC5883L.h>
+
+// Store our compass as a variable.
+HMC5883L compass;
+
+// Record any errors that may occur in the compass.
+int error = 0;
+
+// Out setup routine, here we will configure the microcontroller and compass.
+void setup()
+{
+  // Initialize the serial port.
+  Serial.begin(9600);
+
+  // Start the I2C interface.
+  Wire.begin();
+
+  // Construct a new HMC5883 compass.
+  compass = HMC5883L();
+
+  // Set the scale of the compass.
+  error = compass.SetScale(1.3);
+
+  // Set the measurement mode to Continuous
+  error = compass.SetMeasurementMode(Measurement_Continuous);
+}
+
+// Our main program loop.
+void loop()
+{
+  // Retrived the scaled values from the compass (scaled to the configured scale).
+  MagnetometerScaled scaled = compass.ReadScaledAxis();
+
+  // Output the data via the serial port.
+  Output(scaled);
+
+  // Normally we would delay the application by 66ms to allow the loop
+  // to run at 15Hz (default bandwidth for the HMC5883L).
+  // However since we have a long serial out (104ms at 9600) we will let
+  // it run at its natural speed.
+  // delay(66);
+}
+
+// Output the data down the serial port.
+void Output(MagnetometerScaled scaled)
+{
+   Serial.print(scaled.XAxis);
+   Serial.print(",");
+   Serial.print(scaled.YAxis);
+   Serial.print(",");
+   Serial.print(scaled.ZAxis);
+   Serial.println();
+}


less output

less output

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


Arduino sketch for the sensor

Arduino sketch for the sensor

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

--- sensor/sensor.ino
+++ sensor/sensor.ino
@@ -0,0 +1,44 @@
+#include <LowPower.h>
+#include <avr/wdt.h>
+
+#include <SPI.h>
+
+#include <nRF24L01.h>
+#include <RF24.h>
+#include <RF24_config.h>
+
+
+RF24* radio;
+int TOILET = 0; // Make this unique for each sensor
+int CHANNEL = 0x60;
+int PIPE = 0x7272727069;
+
+void setup() {
+  // Serial.begin(9600);
+  radio = new RF24(10, 9);
+  radio->begin();
+  delay(1000);
+  radio->setPayloadSize(1);
+  radio->setChannel(CHANNEL);
+  radio->setDataRate(RF24_250KBPS);
+  radio->setPALevel(RF24_PA_MAX);
+
+  radio->openWritingPipe(PIPE);
+  attachInterrupt(0, handleInterrupt, CHANGE);
+}
+
+void handleInterrupt() {
+  wdt_disable(); // Disable watchdog timer
+}
+
+void sendStatus() {
+  radio->powerUp();
+  char v[1] = {digitalRead(2) | (TOILET << 1)};
+  radio->write(v, 2);
+  radio->powerDown();
+}
+
+void loop() {
+  LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
+  sendStatus();
+}


Adjusted Mono Origins

Adjusted Mono Origins

changed trims to free the tuning switch

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


Tentiada velocidade

Tentiada velocidade

Código para detectar velocidade de queda livre, funciona relativamente
bem se não houver propulsão . Precisa de calibração inicial.

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

--- FreeFall_embedded/NeisSpeed.ino
+++ FreeFall_embedded/NeisSpeed.ino
@@ -0,0 +1,135 @@
+
+// I2Cdev and MPU6050 must be installed as libraries, or else the .cpp/.h files
+// for both classes must be in the include path of your project
+#include "I2Cdev.h"
+#include "MPU6050.h"
+#include "Wire.h"
+#include "Timer.h"
+
+#define scale 150
+#define TIME_EXECUTION 10    //ms
+
+#define PONDERACAO_MEDIA 10
+
+#define ERRO_ASSOCIADO 4000
+
+#define AMOSTRAS_ADAPT 100
+
+
+MPU6050 accelgyro;
+
+Timer t;
+
+int16_t ax, ay, az;                   // Variaveis que recebem os valores do acelerometro
+int32_t ax_med, ay_med, az_med;       // Variaveis que recebem os valores medios dos eixos
+
+int32_t modulo, repouso;
+bool dadosNovos = true;
+
+int16_t sum1, sum2, sum3, dif, acceleration, acceleration2;
+int32_t speedFall = 0;
+int32_t displaySpeed = 0;
+int16_t count = 0;
+
+#define LED_PIN 13
+bool blinkState = true;
+
+void setup() {
+
+     Wire.begin();
+    // (38400 chosen because it works as well at 8MHz as it does at 16MHz, but
+    Serial.begin(38400);
+
+    // initialize device
+    Serial.println("Initializing I2C devices...");
+    accelgyro.initialize();
+
+    // verify connection
+    Serial.println("Testing device connections...");
+    Serial.println(accelgyro.testConnection() ? "MPU6050 connection successful" : "MPU6050 connection failed");
+
+    pinMode(LED_PIN, OUTPUT);
+
+
+    digitalWrite(LED_PIN, blinkState);
+
+    delay(1000);
+
+    t.every(TIME_EXECUTION, readAcceleration);          // Habilita leitura de dados
+}
+
+
+void loop()
+{
+    t.update();
+    if (dadosNovos)
+    {
+        dadosNovos = false;
+        modulo = (sqrt(ax_med*ax_med + ay_med*ay_med + az_med*az_med));
+
+        if(count < AMOSTRAS_ADAPT)
+        {
+            speedFall = 0;
+            count++;
+            repouso = modulo;
+            if (count == 1)
+            {
+                Serial.println("Adaptando a media");
+            }
+        }
+        else
+        {
+            int16_t resultante;
+
+            acceleration = modulo/scale;      // Apenas para mostrar na tela o modulo
+
+            resultante = repouso - modulo;
+            if (((resultante) > (ERRO_ASSOCIADO)) || ((resultante) < -(ERRO_ASSOCIADO)))
+            {
+                speedFall = speedFall + ((resultante * TIME_EXECUTION)/scale);
+            }
+
+            displaySpeed = abs(speedFall);
+
+#ifdef _DEBUG
+        // display tab  -separated accel/gyro x/y/z values
+            Serial.print("\t");
+            Serial.print("a:\t");
+            Serial.print(ax_med); Serial.print("\t");
+            Serial.print(ay_med); Serial.print("\t");
+            Serial.print(az_med); Serial.print("\t");
+            Serial.print(repouso); Serial.print("\t");
+            Serial.print(modulo); Serial.print("\t");
+            Serial.print(acceleration);Serial.print("\t");
+            Serial.print(speedFall);Serial.print("\t");
+            Serial.println(displaySpeed/1000);
+
+#endif
+
+#ifndef _DEBUG
+            Serial.print("\t");
+            Serial.print(displaySpeed/2778);
+            Serial.println(" km//h");
+#endif
+
+
+        // blink LED to indicate activity
+            blinkState = !blinkState;
+            digitalWrite(LED_PIN, blinkState);
+        }
+    }
+    //else        // Serve apenas para verificar se está "dando tempo" de tratar antes de estourar o tempo
+    //{
+    //    Serial.println("\n####");
+    //}
+}
+
+void readAcceleration()
+{
+    accelgyro.getAcceleration(&ax, &ay, &az);       // Lê os dados do acelerometro
+
+    ax_med = ((ax_med*PONDERACAO_MEDIA) + ax)/(1 + PONDERACAO_MEDIA);      // Varia os eixos conforme uma média
+    ay_med = ((ay_med*PONDERACAO_MEDIA) + ay)/(1 + PONDERACAO_MEDIA);
+    az_med = ((az_med*PONDERACAO_MEDIA) + az)/(1 + PONDERACAO_MEDIA);
+    dadosNovos = true;
+}


added a slight delay to loop in DigitalReadSerial example so we don't overload Serial Monitor

--- build/shared/examples/01.Basics/DigitalReadSerial/DigitalReadSerial.ino
+++ build/shared/examples/01.Basics/DigitalReadSerial/DigitalReadSerial.ino
@@ -22,6 +22,7 @@
   int buttonState = digitalRead(pushButton);
   // print out the state of the button:
   Serial.println(buttonState);
+  delay(1);        // delay in between reads for stability
 }


added new example for publish and subscribe on the same routine

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

--- examples/subscribe_and_publish/subscribe_and_publish.ino
+++ examples/subscribe_and_publish/subscribe_and_publish.ino
@@ -0,0 +1,59 @@
+/****************************************
+ * Include Libraries
+ ****************************************/
+#include "UbidotsESPMQTT.h"
+
+/****************************************
+ * Define Constants
+ ****************************************/
+#define TOKEN "....." // Your Ubidots TOKEN
+#define WIFINAME "....." //Your SSID
+#define WIFIPASS "....." // Your Wifi Pass
+#define MQTTCLIENTNAME "....." // Your MQTT Client Name, it must be unique so we recommend to choose a random ASCCI name
+
+
+Ubidots client(TOKEN, MQTTCLIENTNAME);
+
+/****************************************
+ * Auxiliar Functions
+ ****************************************/
+
+void callback(char* topic, byte* payload, unsigned int length) {
+  Serial.print("Message arrived [");
+  Serial.print(topic);
+  Serial.print("] ");
+  for (int i=0;i<length;i++) {
+    Serial.print((char)payload[i]);
+  }
+  if ((char)payload[0]=='1'){
+    digitalWrite(16, HIGH);
+  }
+  else{
+    digitalWrite(16, LOW);
+  }
+  Serial.println();
+}
+
+/****************************************
+ * Main Functions
+ ****************************************/
+
+void setup() {
+  // put your setup code here, to run once:
+  Serial.begin(115200);
+  client.wifiConnection(WIFINAME, WIFIPASS);
+  client.begin(callback);
+  pinMode(16, OUTPUT);
+  client.ubidotsSubscribe("esp8266","temperature"); //Insert the dataSource and Variable's Labels
+  }
+
+void loop() {
+  // put your main code here, to run repeatedly:
+  if(!client.connected()){
+      client.reconnect();
+      client.ubidotsSubscribe("esp8266","temperature"); //Insert the dataSource and Variable's Labels
+      }
+  client.add("stuff", 10);
+  client.ubidotsPublish("source1");
+  client.loop();
+  }


Added ReadASCIIString example to Communication examples

error: pathspec 'build/shared/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino' did not match any file(s) known to git

--- build/shared/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino
+++ build/shared/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino
@@ -0,0 +1,74 @@
+/*
+  Reading a serial ASCII-encoded string.
+
+ This sketch demonstrates the Serial parseInt() function.
+ It looks for an ASCII string of comma-separated values.
+ It parses them into ints, and uses those to fade an RGB LED.
+
+ Circuit: Common-anode RGB LED wired like so:
+ * Red cathode: digital pin 3
+ * Green cathode: digital pin 5
+ * blue cathode: digital pin 6
+ * anode: +5V
+
+ created 13 Apr 2012
+ by Tom Igoe
+
+ This example code is in the public domain.
+ */
+
+// pins for the LEDs:
+const int redPin = 3;
+const int greenPin = 5;
+const int bluePin = 6;
+
+void setup() {
+  // initialize serial:
+  Serial.begin(9600);
+  // make the pins outputs:
+  pinMode(redPin, OUTPUT);
+  pinMode(greenPin, OUTPUT);
+  pinMode(bluePin, OUTPUT);
+
+}
+
+void loop() {
+  // if there's any serial available, read it:
+  while (Serial.available() > 0) {
+
+    // look for the next valid integer in the incoming serial stream:
+    int red = Serial.parseInt();
+    // do it again:
+    int green = Serial.parseInt();
+    // do it again:
+    int blue = Serial.parseInt();
+
+    // look for the newline. That's the end of your
+    // sentence:
+    if (Serial.read() == '\n') {
+      // constrain the values to 0 - 255 and invert
+      // if you're using a common-cathode LED, just use "constrain(color, 0, 255);"
+      red = 255 - constrain(red, 0, 255);
+      green = 255 - constrain(green, 0, 255);
+      blue = 255 - constrain(blue, 0, 255);
+
+      // fade the red, green, and blue legs of the LED:
+      analogWrite(redPin, red);
+      analogWrite(greenPin, green);
+      analogWrite(bluePin, blue);
+
+      // print the three numbers in one string as hexadecimal:
+      Serial.print(red, HEX);
+      Serial.print(green, HEX);
+      Serial.println(blue, HEX);
+    }
+  }
+}
+
+
+
+
+
+
+
+


Sketch 6-01

Sketch 6-01

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

--- lifeForce/arduino/lifeForce-000.ino
+++ lifeForce/arduino/lifeForce-000.ino
@@ -0,0 +1,41 @@
+/**
+ * Testing digital reading between D4 and GND (ground) pins on board.
+ *
+ * References:
+ *
+ * How to Measure Voltage with a Digital Multimeter
+ * https://www.youtube.com/watch?v=QQWy3_rE5JY
+ *
+ * Source:
+ * Programming Ardunino: Getting Started with Sketches
+ * Chapter 6 - Input and Output
+ * p.85 - 89
+ *
+ * Sketch 6-01
+ */
+
+ int outPin = 4;
+
+ void setup()
+ {
+   pinMode(outPin, OUTPUT);
+   Serial.begin(9600);
+   Serial.println("Enter 1 or 0");
+ }
+
+ void loop()
+ {
+   if (Serial.available() > 0)
+   {
+     char ch = Serial.read();
+     if (ch == '1')
+     {
+       digitalWrite(outPin, HIGH);
+     }
+     else if (ch == '0')
+     {
+       digitalWrite(outPin, LOW);
+     }
+   }
+ }
+


Added logic to set motor position based on temperature sensor reading

/bin/sh: 1: Syntax error: Unterminated quoted string


Initial Arduino sketch. Supports a single thermistor and relay, has relay cooldown, and temperature fuziness. The thermostat temperature must be programmed in (no buttons to change).

--- thermom.ino
+++ thermom.ino
@@ -0,0 +1,84 @@
+#include <LiquidCrystal.h>
+
+
+/*#########################CONSTANTS####################*/
+#define TARGET_TEMP 52
+
+//How many degrees to tolerate before relaying
+#define TEMP_TOLERANCE 1
+
+//how often to read, relay, in milliseconds
+#define READ_DELAY (10*1000)
+#define RELAY_COOLDOWN (20*60*1000)
+
+//where to write the current and goal temperatures on the LCD
+#define LCD_CUR_OFFSET 9, 0
+#define LCD_SET_OFFSET 5, 1
+#define RELAY_PIN 7
+#define THERM_PIN A0
+/*######################################################*/
+
+
+/************************** GLOBALS *********************/
+LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
+
+//the time last read
+int lastRead = -(READ_DELAY + 1);
+int lastRelay = 0;
+int relayStatus = LOW;
+
+/*******************************************************/
+
+
+/**
+* Convert a resistance reading to fahrenheit teperature
+*/
+int conv_temp(int RawADC) {
+  double temp = log(((10240000/RawADC) - 10000));
+  temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * temp * temp ))* temp );
+  temp = temp - 273.15;            // Convert Kelvin to Celcius
+  temp = (temp * 9.0)/ 5.0 + 32.0; // Convert Celcius to Fahrenheit
+  return int(temp);
+}
+
+/* Write the current and target temperature to the LCD */
+void writeLCD(int curTemp, int setTemp){
+  lcd.clear();
+  lcd.setCursor(0, 0);
+  lcd.print("Current:");
+  lcd.setCursor(LCD_CUR_OFFSET);
+  lcd.print(curTemp);
+
+  lcd.setCursor(0, 1);
+  lcd.print("Set:");
+  lcd.setCursor(LCD_SET_OFFSET);
+  lcd.print(setTemp);
+}
+
+void setup(){
+  lcd.begin(20, 2);
+  pinMode(THERM_PIN, INPUT);
+  pinMode(RELAY_PIN, OUTPUT);
+}
+
+void loop(){
+  int now = millis();
+  //only read every now and then
+  if(now - lastRead > READ_DELAY){
+    lastRead = now;
+
+    int temp = conv_temp(analogRead(THERM_PIN));
+    writeLCD(temp, TARGET_TEMP);
+
+    //switch relay if we are over temp and have cooldown
+    if(now - lastRelay >= RELAY_COOLDOWN){
+      lastRelay = now;
+      if(temp > TARGET_TEMP + TEMP_TOLERANCE){
+        relayStatus = HIGH;
+      }else if( temp <= TARGET_TEMP - TEMP_TOLERANCE){
+        relayStatus = LOW;
+      }
+    }
+  }
+  digitalWrite(RELAY_PIN, relayStatus);
+}


Compiled on ESP32

Compiled on ESP32

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


Uso de más libs.

Uso de más libs.

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/nverdicchio/soa-2017-bicicleta-inteligente.git/'


Copy the serial server.

Copy the serial server.

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

--- arduino/serial_test/serial_test.ino
+++ arduino/serial_test/serial_test.ino
@@ -0,0 +1,56 @@
+/***************************************************
+  Simple serial server
+****************************************************/
+
+// Pin 13 has an LED connected on most Arduino boards.
+int led_pin = 13;
+
+//serial
+String inputString = "";         // a string to hold incoming data
+boolean stringComplete = false;  // whether the string is complete
+
+void setup(){
+  //delay(100); //wait for bus to stabalise
+  // serial
+  Serial.begin(9600);
+  // reserve 200 bytes for the inputString:
+  inputString.reserve(200);
+}
+
+void loop(){
+  // print the string when a newline arrives:
+  if (stringComplete) {
+    flash(200);
+    Serial.println(inputString);
+    // clear the string:
+    inputString = "";
+    stringComplete = false;
+  }
+}
+
+/*
+ SerialEvent occurs whenever a new data comes in the
+ hardware serial RX.  This routine is run between each
+ time loop() runs, so using delay inside loop can delay
+ response.  Multiple bytes of data may be available.
+ */
+void serialEvent() {
+  while (Serial.available()) {
+    // get the new byte:
+    char inChar = (char)Serial.read();
+    // add it to the inputString:
+    inputString += inChar;
+    // if the incoming character is a newline, set a flag
+    // so the main loop can do something about it:
+    if (inChar == '\n') {
+      stringComplete = true;
+    }
+  }
+}
+
+// Flash the led for the given time (milliseconds)
+void flash(int msecs){
+    digitalWrite(led_pin, HIGH);
+    delay(msecs);
+    digitalWrite(led_pin, LOW);
+}


Add Edu BP MKII example by @rmMinusR

Add Edu BP MKII example by @rmMinusR

error: pathspec 'build/shared/examples/9.EducationalBP_MKII/JoystickDrawColor/JoystickDrawColor.ino' did not match any file(s) known to git

--- build/shared/examples/9.EducationalBP_MKII/JoystickDrawColor/JoystickDrawColor.ino
+++ build/shared/examples/9.EducationalBP_MKII/JoystickDrawColor/JoystickDrawColor.ino
@@ -0,0 +1,107 @@
+/**
+ * Simple program for drawing in color on the screen of the Educational BoosterPack MK II
+ * @author Robert Christensen
+ * @version 1.0
+ * @see Examples > 9.EducationalBP_MKII > LCD_Joystick
+*/
+
+// Core library for code-sense
+#if defined(ENERGIA) // LaunchPad MSP430, Stellaris and Tiva, Experimeter Board FR5739 specific
+#include "Energia.h"
+#else // error
+#error Platform not defined
+#endif
+
+// Prototypes
+
+
+// Include application, user and local libraries
+#include "SPI.h"
+#include "Screen_HX8353E.h"
+Screen_HX8353E myScreen;
+
+
+// Define variables and constants
+#define joystickX 2
+#define joystickY 26
+#define drawButton 5
+uint16_t x, y;
+uint16_t colour;
+uint32_t z;
+
+uint16_t pixels[16][16];
+
+uint16_t colors[8];
+String colorNames[8] = {"white", "red", "orange", "yellow", "green", "blue", "purple", "pink"};
+byte drawColor = 0;
+
+boolean lastCycleState = true;
+
+void setup() {
+    //Start Serial communication
+    Serial.begin(9600);
+
+    //Initialize myScreen
+    myScreen.begin();
+
+    //Initialize colo(u)rs
+    colors[0] = whiteColour;
+    colors[1] = redColour;
+    colors[2] = orangeColour;
+    colors[3] = yellowColour;
+    colors[4] = greenColour;
+    colors[5] = blueColour;
+    colors[6] = myScreen.calculateColour(191, 0, 255);
+    colors[7] = myScreen.calculateColour(255, 0, 255);
+
+    //Set pixels array to all-black
+    for(int i = 0; i == 16; i++) {
+      for(int j = 0; j == 16; j++) {
+        pixels[i][j] = blackColour;
+      }
+    }
+}
+
+void loop() {
+    x = map(analogRead(joystickX), 0, 4096, 0, 128);
+    y = map(analogRead(joystickY), 0, 4096, 128, 0);
+    if (x < 1)      x = 1;
+    if (x > 126)    x = 126;
+    if (y < 1)      y = 1;
+    if (y > 126)    y = 126;
+
+    //Draw background (pixels)
+    myScreen.setPenSolid(true);
+    myScreen.dRectangle(0, 0, 128, 1, blackColour);
+    for(int ix = 0; ix <= 15; ix++) {
+      for(int iy = 0; iy <= 15; iy++) {
+        myScreen.dRectangle(ix*8, iy*8+1, 8, 8, pixels[ix][iy]);
+      }
+    }
+
+    //If joystickSel pressed, draw at cursor
+    if((!digitalRead(drawButton))&&digitalRead(32)) {
+      pixels[round((x+1)/8)][round((y+1)/8)] = colors[drawColor];
+      Serial.println("Draw:"+(String)round((x+1)/8)+", "+(String)round((y+1)/8));
+    }
+
+    //If button 32 pressed, erase at cursor
+    if((!digitalRead(32))&&digitalRead(drawButton)) {
+      pixels[round((x+1)/8)][round((y+1)/8)] = 0;
+      Serial.println("Erase:"+(String)round((x+1)/8)+", "+(String)round((y+1)/8));
+    }
+
+    //If button 33 pressed, cycle through colors
+    if((!lastCycleState)&&digitalRead(33)) {
+      drawColor++;
+      if(drawColor >= 8) drawColor = 0;
+      Serial.println("Color change to: "+(String)colors[drawColor]+" ("+colorNames[drawColor]+")");
+    }
+
+    //Draw cursor
+    myScreen.setPenSolid(false);
+    myScreen.dRectangle(x-1, y-1 , 8, 8, colors[drawColor]);
+
+    //Update Cycle button state
+    lastCycleState = digitalRead(33);
+}


Added SerialPassthrough sketch to communication examples

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


Added basic serial control

Added basic serial control

Code needs converted to animation

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

--- Serial_Choose_Color/Advanced_08_Ledstrip_Choose_Color.ino
+++ Serial_Choose_Color/Advanced_08_Ledstrip_Choose_Color.ino
@@ -0,0 +1,85 @@
+////////////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2016 Custom FX. All right reserved.
+//
+// Advanced example 08: Ledstrip Choose Color
+//
+// This example shows you how to control individual LEDs in a ledstrip. The first
+// button generates a new random color. The second button selects the next LED
+// in the ledstrip. A blink animation is used to indicate which LED is updated.
+//
+// This file is part of the Custom FX library. This library was developed in
+// order to make Arduino programming as easy as possible. For more information,
+// visit our website: http://www.customfx.nl
+//
+////////////////////////////////////////////////////////////////////////////////
+
+#include <CustomFX.h>
+
+const int max_led = 20;  // use a constant variable to define the number of LEDs
+CFX_LedStrip ledstrip(2, max_led);     // Connect ledstrip to pin 2
+CFX_LedStripPixel pixel(0, &ledstrip);                  // Create a Pixel from the first LED in the ledstrip.
+CFX_LedAnimationBlink blink1(500, 500, &pixel); // The pixel is used for the Blink animation
+CFX_Button button1(7, 101); // button 1 is used to pick new random color
+CFX_Button button2(8, 102); // button 2 is used to select the next LED in the ledstrip
+int led_nr = 0;
+CFX_Color newcolor = CFX_Color(random(0, 0xffffff));
+
+void setup()
+{
+  Serial.begin(9600);
+  Serial.println("Hey there");
+  pixel.SetColor(newcolor); // set the color of the blinking pixel
+}
+
+void handleInput(int id, int command, int value)
+{
+  switch (id)
+  {
+    case 101:
+      switch (command)
+      {
+        case CFX_CMD_BUTTON_PRESSED: // generate new random color
+          newcolor = CFX_Color(random(0, 0xffffff));
+          pixel.SetColor(newcolor);
+          break;
+      }
+      break;
+
+    case 102:
+      switch (command)
+      {
+        case CFX_CMD_BUTTON_PRESSED: // move to next LED in ledstrip
+          ledstrip.SetPixelColor(led_nr, newcolor); // set the color to the current color
+          ledstrip.SetBrightness(255);
+          led_nr++;
+          if (led_nr >= max_led) // when all LEDs are set, move to first LED again
+          {
+            led_nr = 0;
+          }
+          CFX_Color previous_color = ledstrip.GetPixelColor(led_nr); // get current color of the LED
+          if (previous_color != CFX_Color(0)) // if the LED has a color set, use that color
+          {
+            newcolor = previous_color;
+          }
+
+          pixel.SetPixel(led_nr, &ledstrip); // set blink animation on the next LED
+          pixel.SetColor(newcolor);
+          break;
+      }
+      break;
+  }
+}
+
+void loop()
+{
+  if (Serial.available()) {
+    char c = Serial.read();
+    if(c == 'a'){
+      newcolor = CFX_Color(random(0, 0xffffff));
+      pixel.SetColor(newcolor);
+    }
+  }
+
+  CFX_InputController::GetInstance()->ReadInputs();
+  CFX_AnimationController::GetInstance()->UpdateAnimation();
+}


add Socket.IO example for ESP32

add Socket.IO example for ESP32

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

--- examples/esp32/WebSocketClientSocketIOack/WebSocketClientSocketIOack.ino
+++ examples/esp32/WebSocketClientSocketIOack/WebSocketClientSocketIOack.ino
@@ -0,0 +1,155 @@
+/*
+ * WebSocketClientSocketIOack.ino
+ *
+ *  Created on: 20.07.2019
+ *
+ */
+
+#include <Arduino.h>
+
+#include <WiFi.h>
+#include <WiFiMulti.h>
+#include <WiFiClientSecure.h>
+
+#include <ArduinoJson.h>
+
+#include <WebSocketsClient.h>
+#include <SocketIOclient.h>
+
+WiFiMulti WiFiMulti;
+SocketIOclient socketIO;
+
+#define USE_SERIAL Serial
+
+
+void socketIOEvent(socketIOmessageType_t type, uint8_t * payload, size_t length) {
+    switch(type) {
+        case sIOtype_DISCONNECT:
+            USE_SERIAL.printf("[IOc] Disconnected!\n");
+            break;
+        case sIOtype_CONNECT:
+            USE_SERIAL.printf("[IOc] Connected to url: %s\n", payload);
+
+            // join default namespace (no auto join in Socket.IO V3)
+            socketIO.send(sIOtype_CONNECT, "/");
+            break;
+        case sIOtype_EVENT:
+        {
+            char * sptr = NULL;
+            int id = strtol((char *)payload, &sptr, 10);
+            USE_SERIAL.printf("[IOc] get event: %s id: %d\n", payload, id);
+            if(id) {
+                payload = (uint8_t *)sptr;
+            }
+            DynamicJsonDocument doc(1024);
+            DeserializationError error = deserializeJson(doc, payload, length);
+            if(error) {
+                USE_SERIAL.print(F("deserializeJson() failed: "));
+                USE_SERIAL.println(error.c_str());
+                return;
+            }
+
+            String eventName = doc[0];
+            USE_SERIAL.printf("[IOc] event name: %s\n", eventName.c_str());
+
+            // Message Includes a ID for a ACK (callback)
+            if(id) {
+                // creat JSON message for Socket.IO (ack)
+                DynamicJsonDocument docOut(1024);
+                JsonArray array = docOut.to<JsonArray>();
+
+                // add payload (parameters) for the ack (callback function)
+                JsonObject param1 = array.createNestedObject();
+                param1["now"] = millis();
+
+                // JSON to String (serializion)
+                String output;
+                output += id;
+                serializeJson(docOut, output);
+
+                // Send event
+                socketIO.send(sIOtype_ACK, output);
+            }
+        }
+            break;
+        case sIOtype_ACK:
+            USE_SERIAL.printf("[IOc] get ack: %u\n", length);
+            break;
+        case sIOtype_ERROR:
+            USE_SERIAL.printf("[IOc] get error: %u\n", length);
+            break;
+        case sIOtype_BINARY_EVENT:
+            USE_SERIAL.printf("[IOc] get binary: %u\n", length);
+            break;
+        case sIOtype_BINARY_ACK:
+            USE_SERIAL.printf("[IOc] get binary ack: %u\n", length);
+            break;
+    }
+}
+
+void setup() {
+    //USE_SERIAL.begin(921600);
+    USE_SERIAL.begin(115200);
+
+    //Serial.setDebugOutput(true);
+    USE_SERIAL.setDebugOutput(true);
+
+    USE_SERIAL.println();
+    USE_SERIAL.println();
+    USE_SERIAL.println();
+
+      for(uint8_t t = 4; t > 0; t--) {
+          USE_SERIAL.printf("[SETUP] BOOT WAIT %d...\n", t);
+          USE_SERIAL.flush();
+          delay(1000);
+      }
+
+    WiFiMulti.addAP("SSID", "passpasspass");
+
+    //WiFi.disconnect();
+    while(WiFiMulti.run() != WL_CONNECTED) {
+        delay(100);
+    }
+
+    String ip = WiFi.localIP().toString();
+    USE_SERIAL.printf("[SETUP] WiFi Connected %s\n", ip.c_str());
+
+    // server address, port and URL
+    socketIO.begin("10.11.100.100", 8880, "/socket.io/?EIO=4");
+
+    // event handler
+    socketIO.onEvent(socketIOEvent);
+}
+
+unsigned long messageTimestamp = 0;
+void loop() {
+    socketIO.loop();
+
+    uint64_t now = millis();
+
+    if(now - messageTimestamp > 2000) {
+        messageTimestamp = now;
+
+        // creat JSON message for Socket.IO (event)
+        DynamicJsonDocument doc(1024);
+        JsonArray array = doc.to<JsonArray>();
+
+        // add evnet name
+        // Hint: socket.on('event_name', ....
+        array.add("event_name");
+
+        // add payload (parameters) for the event
+        JsonObject param1 = array.createNestedObject();
+        param1["now"] = (uint32_t) now;
+
+        // JSON to String (serializion)
+        String output;
+        serializeJson(doc, output);
+
+        // Send event
+        socketIO.sendEVENT(output);
+
+        // Print JSON for debugging
+        USE_SERIAL.println(output);
+    }
+}


ok, this is what we test tomorrow …

ok, this is what we test tomorrow …

… it should configure the TMC260


Add GSM Serial for testing AT Command

Add GSM Serial for testing AT Command

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

--- examples/GSM-Serial/GSM-Serial.ino
+++ examples/GSM-Serial/GSM-Serial.ino
@@ -0,0 +1,18 @@
+#include <SoftwareSerial.h>
+
+SoftwareSerial SSerial(10, 11);
+
+void setup(void) {
+  Serial.begin(9600);
+  SSerial.begin(9600);
+}
+
+void loop(void) {
+  if (Serial.available() > 0) {
+    SSerial.write(Serial.read());
+  }
+  if (SSerial.available() > 0) {
+    Serial.write(SSerial.read());
+  }
+}
+


first commit

first commit

--- sketch/sketch.ino
+++ sketch/sketch.ino
@@ -0,0 +1,90 @@
+/* サーボのヘッダファイルを準備 */
+#include <Servo.h>
+
+/* サーボモータの制御クラス */
+class ServoIO{
+  int angleCalc(const int currentAngle, const int difference){
+    const int sum = currentAngle + difference;
+    if(sum < 5){return 0;}
+    if(sum > 175){return 180;}
+    return currentAngle + difference;
+  }
+  protected:
+    void rotateServo(const int difference){
+      const int currentAngle = servoPin.read();
+      const int changedAngle = angleCalc(currentAngle, difference);
+      servoPin.write(changedAngle);
+    }
+  public:
+    Servo servoPin;
+};
+
+/* モータの制御クラス */
+class MotorIO{
+  struct MotorState{
+    bool isMoveFoward;
+    bool isStop;
+  };
+  MotorState motorState = {true, false};
+  void motor(){
+    if(! motorState.isStop){
+      if(motorState.isMoveFoward){
+        // Move Foward code here...
+      } else {
+       // Move backward code here...
+      }
+    } else {
+      // Stop code here...
+    }
+  }
+  protected:
+    void moveFoward(){
+      motorState = {true,false};
+    }
+    void moveBackward(){
+      motorState = {false,false};
+    }
+    void moveStop(){
+      motorState = {true,true};
+    }
+  public:
+    void updateMotorState(){
+      motor();
+    }
+};
+
+/* 制御のクラス */
+class IO: public ServoIO, public MotorIO{
+  void error(void){
+    digitalWrite(errorPin,HIGH);
+  }
+  void angleMove(int angle, bool isFoward){
+    rotateServo(angle);
+    if(isFoward){moveFoward();}else{moveBackward();}
+  }
+
+  public:
+    void leftFoward(){angleMove(-30, true);}
+    void rightFoward(){angleMove(30, true);}
+    void leftBackward(){angleMove(-30, false);}
+    void rightBackward(){angleMove(30, false);}
+    int errorPin;
+    void setup(){
+      pinMode(errorPin,OUTPUT);
+    }
+};
+
+IO io;
+
+void setup(){
+  io.errorPin=13;
+  io.servoPin.attach(9);
+}
+
+void loop(){
+//  rotateServo(90);
+//  rotateServo(-90);
+}
+
+
+


initial import.

initial import.

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

--- CalibrateATtiny85OSCCAL.ino
+++ CalibrateATtiny85OSCCAL.ino
@@ -0,0 +1,150 @@
+/*
+ CalibrateATtiny85OSCCAL: Tweak the OSCCAL register to calibrate the internal oscillator of the ATtiny85.
+ Copyright Jason Pepas (Pepas Labs, LLC)
+ Released under the terms of the MIT License.
+
+see https://learn.sparkfun.com/tutorials/serial-communication
+in particular: https://dlnmh9ip6v2uc.cloudfront.net/assets/1/8/d/c/1/51142c09ce395f0e7e000002.png
+see also http://web.alfredstate.edu/weimandn/miscellaneous/ascii/ascii_index.html
+
+consider ASCII '8':
+
+'8' in binary: 00111000
+
+serial is transmitted LSB first, so that would look backwards on
+an oscilloscope: 00011100
+
+the start bit is a 0, and the stop bit is a 1, so the entire byte
+looks like: 0000111001
+
+before the start bit arrives (when the line is idle), the line is
+high.  so you can consider that to be an infinite seris of 1's before
+the start bit:
+
+...11111111111111110000111001
+
+additionally, the line stays high after the stop bit, so on a scope
+you'd really just see two 'dips', the first being 4 bits wide and the
+second 2 bits wide.
+
+...111111111111111100001110011111111111111111...
+
+we'll briefly represent that this way:
+
+...10000111001...
+
+or, visually:
+
+...-____---__-...
+
+here are some interesting characters:
+
+ch    binary     logical             oscilloscope
+===   ========   =================   =================
+NUL   00000000   ...10000000001...   ...-_________-...
+'~'   01111110   ...10011111101...   ...-__------_-...
+'x'   01111000   ...10000111101...   ...-____----_-...
+'8'   00111000   ...10000111001...   ...-____---__-...
+' '   00100000   ...10000001001...   ...-______-__-...
+'@'   01000000   ...10000000101...   ...-_______-_-...
+'U'   01010101   ...10101010101...   ...-_-_-_-_-_-...
+*/
+
+// ATiny85 pinout:
+//
+//                                      +--\/--+
+//        (PCINT5/!RESET/ADC0/dW) PB5  -|1    8|-  VCC
+// (PCINT3/XTAL1/CLKI/!OC1B/ADC3) PB3  -|2    7|-  PB2 (SCK/USCK/SCL/ADC1/T0/INT0/PCINT2)
+//  (PCINT4/XTAL2/CLKO/OC1B/ADC2) PB4  -|3    6|-  PB1 (MISO/DO/AIN1/OC0B/OC1A/PCINT1)
+//                                GND  -|4    5|-  PB0 (MOSI/DI/SDA/AIN0/OC0A/!OC1A/AREF/PCINT0)
+//                                      +------+
+
+#define ARDUINO_PIN_D0 0
+#define ARDUINO_PIN_D1 1
+#define ARDUINO_PIN_D2 2
+#define ARDUINO_PIN_D3 3
+#define ARDUINO_PIN_D4 4
+#define ARDUINO_PIN_D5 5
+
+#define ATTINY_PIN_1 ARDUINO_PIN_D5
+#define ATTINY_PIN_2 ARDUINO_PIN_D3
+#define ATTINY_PIN_3 ARDUINO_PIN_D4
+#define ATTINY_PIN_5 ARDUINO_PIN_D0
+#define ATTINY_PIN_6 ARDUINO_PIN_D1
+#define ATTINY_PIN_7 ARDUINO_PIN_D2
+
+// project pinout:
+//
+//        +--\/--+
+//   D5  -|1    8|-  5V
+//   D3  -|2    7|-  D2
+//   D4  -|3    6|-  D1  TX_pin
+//  GND  -|4    5|-  D0  RX_pin
+//        +------+
+
+#define TX_pin ARDUINO_PIN_D1
+#define RX_pin ARDUINO_PIN_D0
+
+
+#include <SoftwareSerial.h>
+SoftwareSerial ss(RX_pin, TX_pin);
+
+void setup()
+{
+//  OSCCAL = 162;
+
+  pinMode(RX_pin, INPUT);
+  pinMode(TX_pin, OUTPUT);
+
+  ss.begin(9600);
+
+  printOSCCAL();
+}
+
+void loop()
+{
+  while (!ss.available()) delay(1);
+  char ch = ss.read();
+  delay(1);
+
+  switch(ch)
+  {
+    case ']':
+      OSCCAL = OSCCAL + 1;
+      printOSCCAL();
+      break;
+
+    case '[':
+      OSCCAL = OSCCAL - 1;
+      printOSCCAL();
+      break;
+
+    case '?':
+      printOSCCAL();
+      break;
+
+    case '0':
+      printNx100Chars(10);
+      break;
+
+    default:
+      ss.println(ch);
+      break;
+  }
+}
+
+void printOSCCAL()
+{
+  ss.print("OSCCAL: ");
+  ss.println(OSCCAL);
+}
+
+void printNx100Chars(uint16_t n)
+{
+  for (uint16_t i=0; i<n; i++)
+  {
+    ss.print("********* ********* ********* ********* ********* ********* ********* ********* ********* *********!");
+  }
+  ss.println(n*100);
+}
+


Fx board test stubbed in

Fx board test stubbed in

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

--- tests/Console/Fx_Board/Fx_Board.ino
+++ tests/Console/Fx_Board/Fx_Board.ino
@@ -0,0 +1,88 @@
+#include <Streaming.h>
+#include <Metro.h>
+
+#define N_TRIGGER 11
+enum Trigger {
+  BAFF=0,
+  RED=1, GRN=2, BLU=3, YEL=4, WRONG=5,
+  // unused, currently, from here on out
+  U1=6, U2=7, U3=8, U4=9, U5=10
+};
+const int pin[N_TRIGGER] = {
+  30,
+  31,32,33,34,35,
+  36,37,38,39,40
+};
+
+#define FX_RESET 41
+
+class Fx {
+  public:
+    void begin();
+    void reset(); // reset the board
+
+    void on(Trigger); // will never stop
+
+    void off(Trigger);
+    void allOff();
+  private:
+};
+
+Fx fx;
+
+void Fx::begin() {
+  Serial << F("Fx: setup.") << endl;
+
+  // setup pins
+  for(int i=0; i<N_TRIGGER; i++) {
+    digitalWrite(pin[i], HIGH);
+    pinMode(pin[i],OUTPUT);
+  }
+
+  reset();
+
+  Serial << F("Fx: setup complete.") << endl;
+}
+
+void Fx::reset() {
+  // reset the board
+  pinMode(FX_RESET, OUTPUT);
+  digitalWrite(FX_RESET, LOW);
+  delay(1);
+  digitalWrite(FX_RESET, HIGH);
+}
+
+void Fx::on(Trigger t) {
+  digitalWrite(pin[t], LOW);
+}
+void Fx::off(Trigger t) {
+  digitalWrite(pin[t], HIGH);
+}
+
+void Fx::allOff() {
+  // all off
+  for(int i=0; i<N_TRIGGER; i++) {
+    digitalWrite(pin[i], HIGH);
+  }
+}
+
+void setup() {
+  Serial.begin(115200);
+  fx.begin();
+
+  Serial << "BAFF's..." << endl;
+  fx.on(BAFF);
+  delay(10000);
+  fx.off(BAFF);
+
+  Serial << "RED's..." << endl;
+  fx.on(RED); delay(1000); fx.off(RED); delay(1000);
+  fx.on(GRN); delay(1000); fx.off(GRN); delay(1000);
+  fx.on(BLU); delay(1000); fx.off(BLU); delay(1000);
+  fx.on(YEL); delay(1000); fx.off(YEL); delay(1000);
+  fx.on(WRONG); delay(1000); fx.off(WRONG); delay(1000);
+
+}
+
+void loop() {
+}


and this is the rough sketch of homing …

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


improved comments and added defined constants for readability

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


Add PWM test sketch

Add PWM test sketch

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

--- code/orb_pwm_test/orb_pwm_test.ino
+++ code/orb_pwm_test/orb_pwm_test.ino
@@ -0,0 +1,156 @@
+/*
+  Cycles through each LED of the orb
+   - using PWM to fade between them
+   - uses a variation on the TCNT0/slot method discussed here:
+     http://jeelabs.org/2010/10/03/software-pwm-at-1-khz/
+
+  2011-11-19 <nick.oleary@gmail.com>
+  http://opensource.org/licenses/mit-license.php
+*/
+
+#define l1rm 0x80
+#define l1gm 0x40
+#define l1bm 0x20
+
+#define l2rm 0x01
+#define l2gm 0x02
+#define l2bm 0x04
+
+#define l3rm 0x08
+#define l3gm 0x10
+#define l3bm 0x20
+
+byte current[9];
+
+byte fadeTarget[9];
+int fadeSteps[9];
+int fadeStep;
+int fadeStepCount = 20;
+boolean fading;
+int stepCount;
+
+unsigned long timer;
+
+byte portDSlots[256];
+byte portCSlots[256];
+
+void jumpTo(int r1,int g1,int b1,int r2,int g2,int b2,int r3,int g3,int b3) {
+  current[0] = r1;
+  current[1] = g1;
+  current[2] = b1;
+  current[3] = r2;
+  current[4] = g2;
+  current[5] = b2;
+  current[6] = r3;
+  current[7] = g3;
+  current[8] = b3;
+  setupSlots(r1,g1,b1,r2,g2,b2,r3,g3,b3);
+}
+
+void setupSlots(int r1,int g1,int b1,int r2,int g2,int b2,int r3,int g3,int b3) {
+  current[0] = r1;
+  current[1] = g1;
+  current[2] = b1;
+  current[3] = r2;
+  current[4] = g2;
+  current[5] = b2;
+  current[6] = r3;
+  current[7] = g3;
+  current[8] = b3;
+
+  memset(portDSlots,0,256);
+  memset(portCSlots,0,256);
+
+  for (int i=0;i<256;i++) {
+    portDSlots[i] = ((r1>i)?l1rm:0)|((g1>i)?l1gm:0)|((b1>i)?l1bm:0);
+    portCSlots[i] = ((r2>i)?l2rm:0)|((g2>i)?l2gm:0)|((b2>i)?l2bm:0)|
+                    ((r3>i)?l3rm:0)|((g3>i)?l3gm:0)|((b3>i)?l3bm:0);
+  }
+}
+
+void fadeTo(int r1,int g1,int b1,int r2,int g2,int b2,int r3,int g3,int b3) {
+  fadeTarget[0] = r1;
+  fadeTarget[1] = g1;
+  fadeTarget[2] = b1;
+  fadeTarget[3] = r2;
+  fadeTarget[4] = g2;
+  fadeTarget[5] = b2;
+  fadeTarget[6] = r3;
+  fadeTarget[7] = g3;
+  fadeTarget[8] = b3;
+
+  for (int i=0;i<9;i++) {
+    fadeSteps[i] = (fadeTarget[i]-current[i])/fadeStepCount;
+  }
+  fadeStep = 0;
+  fading = true;
+
+}
+void stepFade() {
+  fadeStep++;
+  if (fadeStep == fadeStepCount) {
+    for (int i=0;i<9;i++) {
+      current[i] = fadeTarget[i];
+    }
+    fading = false;
+
+  } else {
+    for (int i=0;i<9;i++) {
+      current[i] += fadeSteps[i];
+      if (fadeSteps[i] > 0 && current[i] > fadeTarget[i]) current[i] = fadeTarget[i];
+      else if (fadeSteps[i] < 0 && current[i] < fadeTarget[i]) current[i] = fadeTarget[i];
+    }
+  }
+  jumpTo(current[0],current[1],current[2],current[3],current[4],current[5],current[6],current[7],current[8]);
+}
+
+
+void setup() {
+  DDRD = DDRD | B11111100;
+  DDRC = DDRC | B00111111;
+  fading = false;
+  jumpTo(0,0,0,0,0,0,0,0,0);
+  timer = millis();
+}
+
+int state = 0;
+
+void loop() {
+  if (millis()-timer > 1000) {
+    timer = millis();
+    if (state == 0) {
+      fadeTo(255,0,0,0,0,0,0,0,0);
+    } else if (state == 1) {
+      fadeTo(0,255,0,0,0,0,0,0,0);
+    } else if (state == 2) {
+      fadeTo(0,0,255,0,0,0,0,0,0);
+    } else if (state == 3) {
+      fadeTo(0,0,0,255,0,0,0,0,0);
+    } else if (state == 4) {
+      fadeTo(0,0,0,0,255,0,0,0,0);
+    } else if (state == 5) {
+      fadeTo(0,0,0,0,0,255,0,0,0);
+    } else if (state == 6) {
+      fadeTo(0,0,0,0,0,0,255,0,0);
+    } else if (state == 7) {
+      fadeTo(0,0,0,0,0,0,0,255,0);
+    } else if (state == 8) {
+      fadeTo(0,0,0,0,0,0,0,0,255);
+    }
+    state++;
+    if (state == 9) state = 0;
+  }
+
+  PORTD = (PORTD&0x03)|portDSlots[TCNT0];
+  PORTC = (PORTC&0xC0)|portCSlots[TCNT0];
+
+  if (fading) {
+    if (TCNT0 == 255) {
+      stepCount++;
+    }
+    if (stepCount == 16) {
+      stepFade();
+      stepCount = 0;
+    }
+  }
+}


SSID witht ESP id, added configurable mqtt parameters


UID to String Example

UID to String Example

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


bicolor bargraph

bicolor bargraph

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

--- examples/bargraph24/bargraph24.ino
+++ examples/bargraph24/bargraph24.ino
@@ -0,0 +1,65 @@
+/***************************************************
+  This is a library for our I2C LED Backpacks
+
+  Designed specifically to work with the Adafruit LED 24 Bargraph Backpack
+  ----> http://www.adafruit.com/products/721
+
+  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
+ ****************************************************/
+
+#include <Wire.h>
+#include "Adafruit_LEDBackpack.h"
+#include "Adafruit_GFX.h"
+
+Adafruit_24bargraph bar = Adafruit_24bargraph();
+
+void setup() {
+  Serial.begin(9600);
+  Serial.println("HT16K33 Bi-Color Bargraph test");
+
+  bar.begin(0x70);  // pass in the address
+
+  for (uint8_t b=0; b<24; b++ ){
+    if ((b % 3) == 0)  bar.setBar(b, LED_RED);
+    if ((b % 3) == 1)  bar.setBar(b, LED_YELLOW);
+    if ((b % 3) == 2)  bar.setBar(b, LED_GREEN);
+  }
+  bar.writeDisplay();
+  delay(2000);
+}
+
+
+void loop() {
+ for (uint8_t b=0; b<24; b++) {
+   bar.setBar(b, LED_RED);
+   bar.writeDisplay();
+   delay(50);
+   bar.setBar(b, LED_OFF);
+   bar.writeDisplay();
+ }
+  for (uint8_t b=0; b<24; b++) {
+   bar.setBar(b, LED_GREEN);
+   bar.writeDisplay();
+   delay(50);
+   bar.setBar(b, LED_OFF);
+   bar.writeDisplay();
+ }
+
+ for (uint8_t b=0; b<24; b++) {
+   bar.setBar(23-b, LED_YELLOW);
+   bar.writeDisplay();
+   delay(50);
+   bar.setBar(23-b, LED_OFF);
+   bar.writeDisplay();
+ }
+}


Create dragino.ino

Create dragino.ino

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

--- arduino/dragino.ino
+++ arduino/dragino.ino
@@ -0,0 +1 @@
+


Added caliper data to repo

Added caliper data to repo

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

--- caliperdata/caliperdata.ino
+++ caliperdata/caliperdata.ino
@@ -0,0 +1,99 @@
+//Digital caliper code to read the value off of a cheap set of digital calipers
+//By Making Stuff Youtube channel https://www.youtube.com/c/makingstuff
+//This code is open source and in the public domain.
+
+const byte clockPin = 2;  //attach to clock pin on calipers
+const byte dataPin = 3; //attach to data pin on calipers
+
+//Milliseconds to wait until starting a new value
+//This can be a different value depending on which flavor caliper you are using.
+const int cycleTime = 32;
+
+unsigned volatile int clockFlag = 0;
+
+long now = 0;
+long lastInterrupt = 0;
+long value = 0;
+
+float finalValue = 0;
+float previousValue = 0;
+
+int newValue = 0;
+int sign = 1;
+int currentBit = 1;
+
+void setup() {
+  Serial.begin(115200);
+
+  pinMode(clockPin, INPUT);
+  pinMode(dataPin, INPUT);
+
+
+  //We have to take the value on the RISING edge instead of FALLING
+  //because it is possible that the first bit will be missed and this
+  //causes the value to be off by .01mm.
+  attachInterrupt(digitalPinToInterrupt(clockPin), clockISR, FALLING);
+}
+
+void loop() {
+
+  if(newValue)
+  {
+   if(finalValue != previousValue) {
+     previousValue = finalValue;
+     Serial.println(finalValue,2);
+   }
+   newValue = 0;
+  }
+
+ //The ISR Can't handle the arduino command millis()
+ //because it uses interrupts to count. The ISR will
+ //set the clockFlag and the clockFlag will trigger
+ //a call the decode routine outside of an ISR.
+ if(clockFlag == 1)
+ {
+  clockFlag = 0;
+  decode();
+ }
+
+}
+
+void decode(){
+   unsigned char dataIn;
+   dataIn = digitalRead(dataPin);
+
+   now = millis();
+
+   if((now - lastInterrupt) > cycleTime)
+   {
+     finalValue = (-1 *(value * sign) / 100.00);
+     currentBit = 0;
+     value = 0;
+     sign = 1;
+     newValue = 1;
+   }
+   else if (currentBit < 16 )
+   {
+
+     if (dataIn == 0)
+     {
+       if (currentBit < 16) {
+          value |= 1 << currentBit;
+       }
+       else if (currentBit == 20) {
+          sign = -1;
+       }
+
+     }
+
+     currentBit++;
+
+   }
+
+   lastInterrupt = now;
+
+}
+
+void clockISR(){
+ clockFlag = 1;
+}


Create master_unor3.ino

Create master_unor3.ino

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

--- au/master_unor3.ino
+++ au/master_unor3.ino
@@ -0,0 +1,69 @@
+#include "RS485_protocol.h"
+#include <SoftwareSerial.h>
+
+const byte ENABLE_PIN = 4;
+const byte LED_PIN = 13;
+
+SoftwareSerial rs485 (2, 3);  // receive pin, transmit pin
+
+// callback routines
+
+void fWrite (const byte what)
+  {
+  rs485.write (what);
+  }
+
+int fAvailable ()
+  {
+  return rs485.available ();
+  }
+
+int fRead ()
+  {
+  return rs485.read ();
+  }
+
+void setup()
+{
+  rs485.begin (38400);
+  pinMode (ENABLE_PIN, OUTPUT);  // driver output enable
+ pinMode (LED_PIN, OUTPUT);  // built-in LED
+}  // end of setup
+
+byte old_level = 0;
+
+void loop()
+{
+
+  // read potentiometer
+ // byte level = analogRead (0) / 4;
+  long level = random(20,32);
+
+
+  // no change? forget it
+  if (level == old_level)
+    return;
+
+  // assemble message
+  byte msg [] = {
+     1,    // device 1
+     2,    // turn light on
+     level // to what level
+  };
+
+  // send to slave
+  digitalWrite (ENABLE_PIN, HIGH);  // enable sending
+  sendMsg (fWrite, msg, sizeof msg);
+  digitalWrite (ENABLE_PIN, LOW);  // disable sending
+
+  // receive response
+  byte buf [10];
+  byte received = recvMsg (fAvailable, fRead, buf, sizeof buf);
+
+  digitalWrite (LED_PIN, received == 0);  // turn on LED if error
+
+  // only send once per successful change
+  if (received)
+    old_level = level;
+
+}  // end of loop


update with SPEED_REDUCER

update with SPEED_REDUCER

added debugging

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


clenup the code

clenup the code

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


Add files via upload

Add files via upload

Code for fire effect on commemorative plaque for Mayor Emanuel

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

--- pixelFireSign/pixelFireSign.ino
+++ pixelFireSign/pixelFireSign.ino
@@ -0,0 +1,68 @@
+#include <Adafruit_NeoPixel.h>
+#ifdef __AVR__
+#include <avr/power.h>
+#endif
+
+#define leftPin 5
+#define rightPin 6
+#define stripLength 6
+
+//  The overall fire brightness
+const int brightness = 225;
+
+struct RGB {
+  byte r;
+  byte g;
+  byte b;
+};
+
+//  The flame color array (the first is the default):
+RGB flameColors[] = {
+  { 255, 95, 0},  // Orange flame
+  { 226, 15, 30}    // Red flame
+};
+
+//  Tracks the current color
+const int currentColorIndex = 0;
+
+Adafruit_NeoPixel leftStrip = Adafruit_NeoPixel(stripLength, leftPin, NEO_GRB + NEO_KHZ800);
+Adafruit_NeoPixel rightStrip = Adafruit_NeoPixel(stripLength, rightPin, NEO_GRB + NEO_KHZ800);
+
+
+void setup() {
+
+  #if defined (__AVR_ATtiny85__)
+    if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
+  #endif
+
+  leftStrip.begin();
+  rightStrip.begin();
+  leftStrip.setBrightness(brightness);
+  rightStrip.setBrightness(brightness);
+  leftStrip.show();
+  rightStrip.show();
+}
+
+void loop() {
+  //  Get the current colors based on the color index:
+  RGB currentColor = flameColors[currentColorIndex];
+
+  //  Flicker, based on our initial RGB values.
+  for (int i = 0; i < stripLength; i++) {
+    int flicker = random(0, 85);
+    int r1 = currentColor.r - flicker;
+    int g1 = currentColor.g - flicker;
+    int b1 = currentColor.b - flicker;
+    if (g1 < 0) g1 = 0;
+    if (r1 < 0) r1 = 0;
+    if (b1 < 0) b1 = 0;
+    leftStrip.setPixelColor(i, r1, g1, b1);
+    rightStrip.setPixelColor(i, r1, g1, b1);
+  }
+
+  leftStrip.show();
+  rightStrip.show();
+  //  Adjust the delay here, if you'd like.  Right now, it randomizes the
+  //  color switch delay to give a sense of realism
+  delay(random(10, 45));
+}


Arduino Mega

Arduino Mega

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

--- vigaro/vigaro.ino
+++ vigaro/vigaro.ino
@@ -0,0 +1,59 @@
+
+const byte pinRed = 8;
+const byte pinGreen = 9;
+const byte pinBlue = 10;
+
+const byte pinHSync = 4; //
+const byte pinVSync = 5; // frame on/off
+
+void HSync()
+{
+  digitalWrite(pinHSync, LOW);
+  delayMicroseconds(4);
+  digitalWrite(pinHSync, HIGH);
+}
+
+void VSync()
+{
+  digitalWrite(pinVSync, LOW);
+  delayMicroseconds(64);
+  digitalWrite(pinVSync, HIGH);
+}
+
+void setPixel(int x, int y)
+{
+  analogWrite(pinRed, 128);
+  analogWrite(pinGreen, 128);
+  analogWrite(pinBlue, 128);
+  delayMicroseconds(1);
+}
+
+void setup()
+{
+  pinMode(pinRed, OUTPUT);
+  pinMode(pinGreen, OUTPUT);
+  pinMode(pinBlue, OUTPUT);
+  analogWrite(pinRed, 128);
+  analogWrite(pinGreen, 128);
+  analogWrite(pinBlue, 128);
+
+  pinMode(pinHSync, OUTPUT);
+  pinMode(pinVSync, OUTPUT);
+  digitalWrite(pinHSync, HIGH);
+  digitalWrite(pinVSync, HIGH);
+
+  setPixel(1, 1);
+}
+
+void loop()
+{
+  VSync(); // 60 Hz -> 16,6 ms
+  for (int y=0; y<480; y++)
+  {
+    digitalWrite(pinHSync, LOW);
+    delayMicroseconds(4);
+    digitalWrite(pinHSync, HIGH);
+    delayMicroseconds(10);
+  }
+}
+


Create VeCToR_Letters.ino

Create VeCToR_Letters.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/TEAMarg/VeCToR_Letters.git/'


Added new type of sensor (based on mysens.org). Soil + battery level


added LED segment laptimer test code

added LED segment laptimer test code


cleaned up tft display

cleaned up tft display

error: pathspec 'Microcontroller' did not match any file(s) known to git
error: pathspec 'Code/libraries/my_lib/examples/base_uno_w_lib/base_uno_w_lib.ino' did not match any file(s) known to git


Create AD9850.ino

Create AD9850.ino

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

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


ensuring complete shaddow registers

ensuring complete shaddow registers


Connected LED!

Connected LED!

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


Updated information.

Updated information.

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


Initial commit of code

Initial commit of code

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

--- ISPFuseRescue.ino
+++ ISPFuseRescue.ino
@@ -0,0 +1,71 @@
+//	FuseRescue
+//	This sketch licensed under the MIT License (MIT)
+//	Copyright (c) 2015 hieromon@gmail.com
+//
+// ArduinoISP version 04m3
+// Copyright (c) 2008-2011 Randall Bohn
+// If you require a license, see
+//     http://www.opensource.org/licenses/bsd-license.php
+//
+// This sketch to aggregate two functions of the ArduinoISP and the FuseRescue.
+// Enable either the FuseRecue or ArduinoISP by A0 signal.
+// ArduinoISP sketch was captured by the .cpp file from the original code that
+// is in the example of Arduino IDE and it was capsuled in the namespace as
+// ArduinoISP. The original logic has not been modified.
+
+#include <Arduino.h>
+#include <MsTimer2.h>
+#include "FuseRescue.h"
+#include "ArduinoISP.h"
+#include "ISPFuseRescue.h"
+
+// Current function of PCB
+static PCBFUNC	PCBMODE;
+
+// Sensing the operational function either ArduinoISP or FuseRescue
+PCBFUNC sense_pcb(void) {
+	PCBFUNC	pcbSelection;
+
+	// Power-up the target chip, the mode sense pin will be in non-dependent
+	// from the target chip.
+	pinMode(VCC_ENABLE, OUTPUT);
+	digitalWrite(VCC_ENABLE, HIGH);
+	// Wait for ACTMODE pin stable
+	delay(1);
+
+	// Detect PCB operation mode
+	// ACTMODE pin is High, operation is FuseRescue
+	// ACTMODE pin is Low, operation is Arduino ISP
+	pinMode(ACTMODE, INPUT);
+	pcbSelection = digitalRead(ACTMODE) == HIGH ? PCB_FUSERESCUE : PCB_ARDUINOISP;
+
+	// Release the mode sense pin, turn off target chip.
+	digitalWrite(VCC_ENABLE, LOW);
+	// Stop completely the target chip waiting for discharge of the capacitor.
+	delay(100);
+
+	return pcbSelection;
+}
+
+void setup() {
+	// Operation mode selection
+	switch (PCBMODE = sense_pcb()) {
+	case PCB_ARDUINOISP:
+		ArduinoISP::setup();
+		break;
+	case PCB_FUSERESCUE:
+		FuseRescue::setup();
+		break;
+	}
+}
+
+void loop() {
+	switch (PCBMODE) {
+	case PCB_ARDUINOISP:
+		ArduinoISP::loop();
+		break;
+	case PCB_FUSERESCUE:
+		FuseRescue::loop();
+		break;
+	}
+}


Create userFunctions.ino

Create userFunctions.ino

error: pathspec '1.1/Arduino/HAL-W/userFunctions.ino' did not match any file(s) known to git

--- 1.1/Arduino/HAL-W/userFunctions.ino
+++ 1.1/Arduino/HAL-W/userFunctions.ino
@@ -0,0 +1,23 @@
+//modify this file with the functions you need to run your commands
+//import aditional libraries (ones not used in HAL-W.ino) here
+
+
+//This is the primary switch that takes the input (your command number) and then does you commands
+void mainSwitch(unsigned long cmdNumber)
+{
+  switch(cmdNumber) {
+    case 0:
+      Serial.println("locked");
+      break;
+    case 1:
+      Serial.println("Command 1");
+      //code for command 1
+      break;
+    default:
+      Serial.println("UNKNOWN COMMAND");
+      break;
+  }
+}
+
+//add aditional functions for your commands here
+


int → unsigned int in callback function

int → unsigned int in callback function

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


New test setup, added LDR and Pot

New test setup, added LDR and Pot

KnobPin = A6;
LDRPin = A7;
stripPin = 5;
Button1 = 6;
Button2 = 7;

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

--- arduino/Clock30/Clock30.ino
+++ arduino/Clock30/Clock30.ino
@@ -0,0 +1,112 @@
+#include <Adafruit_NeoPixel.h>
+
+int KnobPin = A6;    // select the input pin for the potentiometer
+int LDRPin = A7;     // select the input pin for the LDR
+int stripPin = 5;       //select the pin the strip is on
+int numLEDS = 128;        //number of LEDS in the astrip
+int j;
+int KnobValue, LDRValue = 0;  // variable to store the value coming from the sensor
+
+Adafruit_NeoPixel strip = Adafruit_NeoPixel(numLEDS, stripPin, NEO_GRB + NEO_KHZ800);
+
+void setup() {
+  // declare the ledPin as an OUTPUT:
+
+  strip.begin();
+  Serial.begin(9600);
+}
+
+
+
+
+void loop() {
+
+
+  // read the value from the sensor:
+  KnobValue = analogRead(KnobPin);
+  LDRValue = analogRead(LDRPin);
+  Serial.print("Knob ");
+  Serial.print(KnobValue);
+  Serial.print("  LDR ");
+  Serial.print(LDRValue);
+  Serial.print("  | ");
+  strip.setBrightness(map(LDRValue,390,1000,0,255));
+
+  if (KnobValue < 50){
+    //light off
+    Serial.println("light off");
+    for(int i=0; i<strip.numPixels(); i++) {
+      strip.setPixelColor(i, strip.Color(0, 0, 0));
+
+    }
+    strip.show();
+  }
+  else if (KnobValue < 150){
+    //rainbow!
+    rainbowCycle(map(KnobValue, 50, 149, 0, 50));
+    Serial.print("rainbow1 - delay ");
+    Serial.println(map(KnobValue, 50, 149, 0, 50));
+  }else if (KnobValue < 300){
+    //rainbow!
+    rainbow(map(KnobValue, 150, 299, 0, 50));
+    Serial.print("rainbow2 - delay ");
+    Serial.println(map(KnobValue, 150, 299, 0, 50));
+  }
+  else  if (KnobValue <1000){
+    //solid colour
+    int colour = map(KnobValue, 300, 999, 0, 255);
+    Serial.print(colour);
+    for(int i=0; i<strip.numPixels(); i++) {
+      strip.setPixelColor(i, Wheel(colour));
+
+    }
+    strip.show();
+    Serial.println(" solid colour");
+  }
+  else {
+    Serial.println("all white");
+
+    for(int i=0; i<strip.numPixels(); i++) {
+      strip.setPixelColor(i, strip.Color(255, 255, 255));
+    }
+    strip.show();
+
+  }
+}
+
+uint32_t Wheel(byte WheelPos) {
+  if(WheelPos < 85   ) {
+    return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
+  }
+  else if(WheelPos < 170) {
+    WheelPos -= 85;
+    return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
+  }
+  else {
+    WheelPos -= 170;
+    return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
+  }
+}
+
+void rainbowCycle(uint8_t wait) {
+
+  j++;
+  if (j > 255) j=0;
+  for(int i=0; i< strip.numPixels(); i++) {
+    strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
+  }
+  strip.show();
+  delay(wait);
+}
+
+void rainbow(uint8_t wait) {
+
+  j++;
+  if (j > 255) j=0;
+  for(int i=0; i< strip.numPixels(); i++) {
+    strip.setPixelColor(i, Wheel(j));
+  }
+  strip.show();
+  delay(wait);
+}
+


just some beautification

just some beautification

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


keep silent

keep silent


Some code based on a friend's robot

Some code based on a friend's robot

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

--- SOURCE/line_follow/line_follow.ino
+++ SOURCE/line_follow/line_follow.ino
@@ -0,0 +1,69 @@
+#include <Servo.h>
+
+Servo servo_0;
+Servo servo_1;
+
+void setup() {
+  servo_0.attach(9);
+  servo_1.attach(10);
+  Serial.begin(9600);
+}
+
+void loop() {
+    //modo seguidor de linha
+    int seg1 = analogRead(A0); // 400
+    int seg2 = analogRead(A1); // 400
+    int seg3 = analogRead(A2); // 400
+    if(seg1 > 400 && seg3 > 400){
+      frente();
+    }else{
+      if(seg1 > 400 && seg2 > 400){
+        esquerda_suave();
+      }else
+      if(seg3 > 400 && seg2 > 400){
+        direita_suave();
+      }else
+      if(seg1 > 400 && seg2 < 400){
+        esquerda();
+      }else
+      if(seg3 > 400 && seg2 < 400){
+        direita();
+      }else
+      if(seg2 > 400 && seg1 < 400 && seg3 < 400){
+        frente();
+      }else{
+        frente();
+      }
+    }
+  delay(50);
+}
+
+void frente() {
+  servo_0.write(180);
+  servo_1.write(0);
+}
+
+void direita() {
+  servo_0.write(180);
+  servo_1.write(180);
+}
+
+void esquerda() {
+  servo_0.write(0);
+  servo_1.write(0);
+}
+
+void direita_suave() {
+  servo_0.write(180);
+  servo_1.write(78);
+}
+
+void esquerda_suave() {
+  servo_0.write(90);
+  servo_1.write(0);
+}
+
+void atras() {
+  servo_0.write(0);
+  servo_1.write(180);
+}


Create color2pi.ino

Create color2pi.ino

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

--- color2pi.ino
+++ color2pi.ino
@@ -0,0 +1,44 @@
+//recives three messages from a python script and reflect it on 3 PWM pins to LEDs
+
+#include <SoftwareSerial.h>
+SoftwareSerial mySerial(10, 11); // RX, TX
+
+// pins for the LEDs:
+const int redPin = 3;
+const int greenPin = 5;
+const int bluePin = 6;
+
+void setup() {
+  // initialize serial:
+  Serial.begin(9600);
+  mySerial.begin(9600);
+
+  // make the pins outputs:
+  pinMode(redPin, OUTPUT);
+  pinMode(greenPin, OUTPUT);
+  pinMode(bluePin, OUTPUT);
+
+}
+
+void loop() {
+  // if there's any serial available, read it:
+  while (mySerial.available() > 0) {
+    int red = mySerial.parseInt();
+    int green = mySerial.parseInt();
+    int blue = mySerial.parseInt();
+
+    blue *= 0.5;
+    green *= 0.5;
+
+    red = constrain(red, 0 , 255);
+    blue = constrain(blue, 0 , 255);
+    green = constrain(green, 0 , 255);
+
+    if (mySerial.read() == '\n') {
+      analogWrite(redPin, red);
+      analogWrite(greenPin, green);
+      analogWrite(bluePin, blue);
+    }
+
+  }
+}


Add AC arduino code

Add AC arduino code

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


Add example

Add example

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

--- examples/Basic.ino
+++ examples/Basic.ino
@@ -0,0 +1,87 @@
+#include "Commandline.h"
+
+// Keep track of the count, for the count command.
+int count = 0;
+
+// CommandLine instance.
+CommandLine commandLine(Serial, "> ");
+
+// Commands are simple structures that can be.
+Command command = Command("count", &handleCount);
+Command addCount = Command("add", &handleAdd);
+Command removeCount = Command("remove", &handleRemove);
+
+/**
+ * Setup serial port and add commands.
+ */
+void setup()
+{
+  Serial.begin(9600);
+
+  // Pre-defined commands
+  commandLine.add(command);
+  commandLine.add(addCount);
+  commandLine.add(removeCount);
+
+  // On-the-fly commands -- instance is allocated dynamically
+  commandLine.add("help", handleHelp);
+}
+
+/**
+ * Read-eval-print-loop.
+ */
+void loop()
+{
+  commandLine.update();
+}
+
+/**
+ * Handle the count command. The command has one additional argument that can be the integer to set the count to.
+ *
+ * @param tokens The rest of the input command.
+ */
+void handleCount(char* tokens)
+{
+  char* token = strtok(NULL, " ");
+
+  if (token != NULL) {
+    count = atoi(token);
+  } else {
+    count++;
+  }
+
+  Serial.println(count);
+}
+
+/**
+ * Add the count command.
+ *
+ * @param tokens The rest of the input command.
+ */
+void handleAdd(char* tokens)
+{
+  commandLine.add(command);
+  Serial.println("Command 'count' added.");
+}
+
+/**
+ * Remove the count command.
+ *
+ * @param tokens The rest of the input command.
+ */
+void handleRemove(char* tokens)
+{
+  commandLine.remove(command);
+  Serial.println("Command 'count' removed.");
+}
+
+/**
+ * Print some help.
+ *
+ * @param tokens The rest of the input command.
+ */
+void handleHelp(char* tokens)
+{
+  Serial.println("Use the commands 'help', 'count', 'enable' or 'disable'.");
+}
+