Added Beam Transit Example

Added Beam Transit Example

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

--- examples/BeamTransit/BeamTransit.ino
+++ examples/BeamTransit/BeamTransit.ino
@@ -0,0 +1,126 @@
+/*
+===========================================================================
+
+  This is an example for Beam.
+
+  Beam is a beautiful LED matrix — features 120 LEDs that displays scrolling text, animations, or custom lighting effects.
+  Beam can be purchased here: http://www.hoverlabs.co
+
+  Written by Emran Mahbub and Jonathan Li for Hover Labs.
+  BSD license, all text above must be included in any redistribution
+
+#  INSTALLATION
+    The 4 library files (beam.cpp, beam.h and charactermap.h and frames.h) are required to run Beam.
+    Run the BeamDemo.ino file.
+
+#  SUPPORT
+    For questions and comments, email us at support@hoverlabs.co
+===========================================================================
+*/
+
+#include "application.h"
+#include "beam.h"
+
+/* pin definitions for Beam */
+#define RSTPIN 2        //use any digital pin
+#define IRQPIN 9        //currently not used
+#define BEAMCOUNT 1     //number of beams daisy chained together
+
+/* Iniitialize an instance of Beam */
+Beam b = Beam(RSTPIN, IRQPIN, BEAMCOUNT);
+
+unsigned long updateTimer = 0;      // timer used to call our webhooks after an elapsed time
+int runNow = 1;                     // flag used to indicate when timer reaches our elapsed time
+
+
+void setup() {
+
+    Serial.begin(9600);
+    Wire.begin();
+
+    Serial.println("Starting Beam example");
+
+    Particle.subscribe("hook-response/bus_info", gotBusData, MY_DEVICES);
+
+    b.begin();
+
+}
+
+void loop() {
+
+    if (runNow == 1){
+
+        Particle.publish("bus_info");
+        runNow = 0;
+        updateTimer = millis();
+    }
+
+    /*
+    wait 45 seconds before calling our publish functions again
+    */
+    if (millis() - updateTimer > 45000){
+        runNow = 1;
+    }
+
+    // do something else here
+
+}
+
+void gotBusData(const char *name, const char *data) {
+
+    String str = String(data);
+    String leaveStr = tryExtractString(str, "<ExpectedLeaveTime>", "</ExpectedLeaveTime>");
+    String destinationStr = tryExtractString(str, "<Destination>", "</Destination>");
+    String countdownStr = tryExtractString(str, "<ExpectedCountdown>", "</ExpectedCountdown>");
+    String routeStr = tryExtractString(str, "<RouteNo>", "</RouteNo>");
+
+    if (routeStr != NULL) {
+        Serial.println("Route No: " + routeStr);
+    }
+
+    if (destinationStr != NULL) {
+        Serial.println("Going to: " + destinationStr);
+    }
+
+    if (countdownStr != NULL) {
+        Serial.println("Leaving in: " + countdownStr + String("Mins"));
+    }
+
+    if (routeStr !=NULL){
+
+        String beamString =  String(routeStr + "   " + destinationStr + "   " + countdownStr + " MINS");
+        beamString.toUpperCase();
+        Serial.println(beamString);
+
+        char buf[1024];
+        beamString.toCharArray(buf, 1024);
+
+        b.begin();
+        b.print(buf);
+        b.setSpeed(5);
+        b.play();
+
+    }
+
+}
+
+// Returns any text found between a start and end string inside 'str'
+// example: startfooend  -> returns foo
+String tryExtractString(String str, const char* start, const char* end) {
+
+    if (str == NULL) {
+        return NULL;
+    }
+
+    int idx = str.indexOf(start);
+    if (idx < 0) {
+        return NULL;
+    }
+
+    int endIdx = str.indexOf(end);
+    if (endIdx < 0) {
+        return NULL;
+    }
+
+    return str.substring(idx + strlen(start), endIdx);
+}


Se anexa un simple lector de tags NFC

Se anexa un simple lector de tags NFC

error: pathspec 'hardware/Prueba_NFC/Prueba_NFC2/Prueba_NFC_2.ino.ino' did not match any file(s) known to git

--- hardware/Prueba_NFC/Prueba_NFC2/Prueba_NFC_2.ino.ino
+++ hardware/Prueba_NFC/Prueba_NFC2/Prueba_NFC_2.ino.ino
@@ -0,0 +1,59 @@
+#include <SPI.h>
+#include <MFRC522.h>
+
+#define RST_PIN	9    //Pin 9 para el reset del RC522
+#define SS_PIN	10   //Pin 10 para el SS (SDA) del RC522
+MFRC522 mfrc522(SS_PIN, RST_PIN); ///Creamos el objeto para el RC522
+
+void setup() {
+	Serial.begin(9600); //Iniciamos La comunicacion serial
+	SPI.begin();        //Iniciamos el Bus SPI
+	mfrc522.PCD_Init(); // Iniciamos el MFRC522
+	Serial.println("Control de acceso:");
+}
+
+byte ActualUID[4]; //almacenará el código del Tag leído
+byte Usuario1[4]= {0xD1, 0xA2, 0x6F, 0x85} ; //código del usuario 1
+byte Usuario2[4]= {0xC1, 0x2F, 0xD6, 0x0E} ; //código del usuario 2
+void loop() {
+	// Revisamos si hay nuevas tarjetas  presentes
+	if ( mfrc522.PICC_IsNewCardPresent())
+        {
+  		//Seleccionamos una tarjeta
+            if ( mfrc522.PICC_ReadCardSerial())
+            {
+                  // Enviamos serialemente su UID
+                  Serial.print(F("Card UID:"));
+                  for (byte i = 0; i < mfrc522.uid.size; i++) {
+                          Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
+                          Serial.print(mfrc522.uid.uidByte[i], HEX);
+                          ActualUID[i]=mfrc522.uid.uidByte[i];
+                  }
+                  Serial.print("     ");
+                  //comparamos los UID para determinar si es uno de nuestros usuarios
+                  if(compareArray(ActualUID,Usuario1))
+                    Serial.println("Acceso concedido...");
+                  else if(compareArray(ActualUID,Usuario2))
+                    Serial.println("Acceso concedido...");
+                  else
+                    Serial.println("Acceso denegado...");
+
+                  // Terminamos la lectura de la tarjeta tarjeta  actual
+                  mfrc522.PICC_HaltA();
+
+            }
+
+	}
+
+}
+
+//Función para comparar dos vectores
+ boolean compareArray(byte array1[],byte array2[])
+{
+  if(array1[0] != array2[0])return(false);
+  if(array1[1] != array2[1])return(false);
+  if(array1[2] != array2[2])return(false);
+  if(array1[3] != array2[3])return(false);
+  return(true);
+}
+


Update for SPI interface

Update for SPI interface

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


control module draft (untested)

control module draft (untested)

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

--- range/arduino/control_module/control_module.ino
+++ range/arduino/control_module/control_module.ino
@@ -0,0 +1,146 @@
+/* control module to run all the things */
+
+#include <Wire.h>
+#include <SL018.h>
+
+#define BAUD 9600
+#define RESEND_TIMER 200
+#define RUN_TIMER 30000
+#define UPDATE_DELAY 10
+#define RFID_DIGITS 15
+#define BUTTON 2
+#define RESET 3
+#define LED 13
+#define TARGET Serial1
+#define SCOREBD Serial2
+#define TIMER Serial3
+
+//states
+#define RFID_READY 1
+#define START_THE_GAME 2
+#define RUNNING 3
+#define CLEAN_UP 4
+
+SL018 rfid;
+
+char player_rfid[RFID_DIGITS];
+unsigned long score = 0;
+int state = RFID_READY;
+unsigned long start_time = 0UL;
+unsigned long last_update = 0UL;
+
+void setup() {
+  Wire.begin();
+  Serial.begin(BAUD);  // Computer/USB connection
+  TARGET.begin(BAUD); // Target module
+  SCOREBD.begin(BAUD); // Scoreboard module
+  TIMER.begin(BAUD); // Timer module
+
+  rfid.seekTag();
+}
+
+void loop() {
+
+  if (state == RFID_READY) {
+    //waiting for new RFID scan
+    stopall();
+    // hold for rfid read
+    while (!rfid.available());
+    strcpy(player_rfid, rfid.getTagString());
+    sendPlayerID();
+    resetall();
+    while(digitalRead(BUTTON) == LOW && digitalRead(RESET) == LOW) {
+      //pulse the led to show we're waiting for input
+      float val = (exp(sin(millis()/1000.0*PI)) - 0.36787944)*108.0;
+      analogWrite(LED, val);
+    }
+    if (digitalRead(BUTTON) == HIGH) {
+      state = START_THE_GAME;
+    }
+  }
+
+  else if (state == START_THE_GAME) {
+    //set the initial conditions for play
+    start();
+    state = RUNNING;
+  }
+
+  else if (state == RUNNING) {
+    // check we're still in the allowed play time
+    if (millis() - start_time <= RUN_TIMER) {
+      // check the frequency of score updates
+      if (millis() - last_update >= RESEND_TIMER) {
+        //update the score to the score boards
+        getScore();
+        last_update = millis();
+      }
+    } else {
+      state = CLEAN_UP;
+    }
+  }
+
+  else if (state == CLEAN_UP) {
+    //stop the target module and display the score
+    stopall();
+    getScore();
+    //report the <rfid>,<score> back to any listening device
+    Serial.print(player_rfid);
+    Serial.print(',');
+    Serial.print(score);
+    Serial.println();
+    state = RFID_READY;
+  }
+}
+
+void stopall() {
+  TARGET.println(F("X"));
+  TIMER.println(F("X"));
+  SCOREBD.println(F("X"));
+}
+
+void resetall() {
+  SCOREBD.println(F("Z"));
+  TIMER.println(F("R"));
+  TARGET.println(F("X"));
+}
+
+void sendPlayerID() {
+  //send the player rfid
+  TARGET.print(F("R"));
+  TARGET.print(player_rfid);
+  TARGET.println(F(";"));
+}
+
+void getScore() {
+  TARGET.println(F("D"));
+  delay(UPDATE_DELAY); // need to wait for a reply
+  if (TARGET.available()) {
+    score = TARGET.parseInt();
+  }
+  SCOREBD.print(F("D"));
+  SCOREBD.println(score);
+}
+
+void start() {
+  //do the start
+  //make a countdown on the scoreboard
+  SCOREBD.println(F("D5"));
+  delay(1000);
+  SCOREBD.println(F("D4"));
+  delay(1000);
+  SCOREBD.println(F("D3"));
+  delay(1000);
+  SCOREBD.println(F("D2"));
+  delay(1000);
+  SCOREBD.println(F("D1"));
+  delay(1000);
+  SCOREBD.println(F("D0"));
+  delay(100);
+  //start listening to the targets
+  TARGET.println(F("S"));
+  //start the timer
+  TIMER.println(F("S"));
+  start_time = millis();
+  last_update = millis() - (2 * RESEND_TIMER);
+}
+


Add ATTiny-Blink sketch

Add ATTiny-Blink sketch

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


Functional moisture sensor using metal rods

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

--- lifeForce/arduino/lifeForce-1002.ino
+++ lifeForce/arduino/lifeForce-1002.ino
@@ -0,0 +1,42 @@
+/**
+   Analog Input - a value between 0 and 1023 depending on the voltage.
+
+   Source:
+   Programming Ardunino: Getting Started with Sketches
+   Chapter 6 - Input and Output
+   p.102 - 103
+
+   Sketch 6-09
+
+*/
+
+int analogPin = A0;
+int reading = 0;
+
+void setup()
+{
+  Serial.begin(19200);
+}
+
+void loop()
+{
+  reading++;
+  Serial.print("Reading count: ");
+  Serial.println(reading);
+
+  int reading = analogRead(A0);
+  Serial.print("Reading = ");
+  Serial.println(reading);
+
+  // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
+  float voltage = reading * (5.0 / 1023.0);
+  Serial.print("Voltage = ");
+  Serial.println(voltage);
+
+  Serial.println();
+  Serial.println("-----");
+  Serial.println();
+
+  delay(2000);
+}
+


Add SpeedProfile sketch

Add SpeedProfile sketch

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

--- examples/SpeedProfile/SpeedProfile.ino
+++ examples/SpeedProfile/SpeedProfile.ino
@@ -0,0 +1,76 @@
+/*
+ * This is not an example sketch, it is used to visualize the motor speed.
+ *
+ * Usage: upload and start Tool -> Serial Plotter
+ *
+ * All driver tests are done with microstep 1. Increasing microstep halves max rpm with each level.
+ * The maximum usable RPM can be determined from the output.
+ * The max RPM at a different microstep can be calculated with formula "max rpm / microstep"
+ *
+ * Copyright (C)2020 Laurentiu Badea
+ *
+ * This file may be redistributed under the terms of the MIT license.
+ * A copy of this license has been included with this distribution in the file LICENSE.
+ */
+#include <Arduino.h>
+
+#include "BasicStepperDriver.h"
+#include "MultiDriver.h"
+#include "SyncDriver.h"
+
+#define RPM 150
+#define MICROSTEP 1
+
+#define MOTOR_STEPS 200
+
+// Do not use with a real motor, the step timing is very delayed due to serial printing.
+BasicStepperDriver s1(MOTOR_STEPS, 12, 13);
+BasicStepperDriver s2(MOTOR_STEPS, 12, 13);
+BasicStepperDriver s3(MOTOR_STEPS, 12, 13);
+
+void setup() {
+    Serial.begin(115200);
+    delay(4000);
+
+    s1.setSpeedProfile(BasicStepperDriver::LINEAR_SPEED, 2000, 2000);
+    s2.setSpeedProfile(BasicStepperDriver::LINEAR_SPEED, 500, 500);
+    s3.setSpeedProfile(BasicStepperDriver::CONSTANT_SPEED);
+
+    s1.begin(RPM, MICROSTEP);
+    s2.begin(RPM, MICROSTEP);
+    s3.begin(RPM, MICROSTEP);
+
+    s1.startMove(500);
+    s2.startMove(500);
+    s3.startMove(500);
+}
+
+void loop() {
+    unsigned w1, w2, w3;
+
+    w1 = s1.nextAction();
+    w2 = s2.nextAction();
+    w3 = s3.nextAction();
+
+    if (w1 > 0 || w2 > 0 || w3 > 0){
+        // uncomment to see step delays instead of speed
+        /*
+        Serial.print(w1);
+        Serial.print("\t");
+        Serial.print(w2);
+        Serial.print("\t");
+        Serial.print(w2);
+        Serial.println();
+        */
+
+        // graph current rpm
+        Serial.print(s1.getCurrentRPM());
+        Serial.print("\t");
+        Serial.print(s2.getCurrentRPM());
+        Serial.print("\t");
+        Serial.print(s3.getCurrentRPM());
+        Serial.println();
+    } else {
+        delay(100000);
+    }
+}


Create modem_client.ino

Create modem_client.ino

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

--- examples/modem_client/modem_client.ino
+++ examples/modem_client/modem_client.ino
@@ -0,0 +1,49 @@
+#include <SoftwareSerial.h>
+#include <sim800.h>
+
+#define FONA_RST 4  // no need to connect this;
+
+SoftwareSerial modemSerial = SoftwareSerial(6,7);
+
+Modem modem = Modem(FONA_RST);
+
+void setup() {
+
+  while (! Serial);
+
+  Serial.begin(9600);
+  Serial.println(F("SIM800 TCP/HTTP demo"));
+  Serial.println(F("Initializing modem... (May take a few seconds)"));
+
+  modemSerial.begin(9600);
+  if (! modem.begin(modemSerial)) {
+    Serial.println(F("Couldn't find modem"));
+    while(1);
+  }
+  Serial.print(F("Checking for Cell network..."));
+  while (modem.getNetworkStatus() != 1);
+
+  Serial.println(F("Registered."));
+  modem.setGPRSNetworkSettings(F("web.gprs.mtnnigeria.net"));
+  modem.enableGPRS(true);
+  if (modem.TCPconnect("httpbin.org", 80)){
+    char req[] = "GET /ip HTTP/1.1\r\nHost: httpbin.org\r\n\r\n";
+    modem.TCPsend(req, strlen(req));
+    uint8_t recv[21];
+    unsigned long lastRead = millis();
+    while (millis() - lastRead < 2000){
+      while (modem.TCPavailable()){
+        uint8_t r = modem.TCPread(recv, 20);
+        recv[r] = 0;
+        Serial.write((char *)recv);
+        lastRead = millis();
+      }
+    }
+    modem.TCPclose();
+    modem.enableGPRS(false);
+  }
+}
+
+void loop() {
+
+}


Create ROAS.ino

Create ROAS.ino

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

--- ROAS.ino
+++ ROAS.ino
@@ -0,0 +1,26 @@
+#include "ROASArdLib.h"
+
+ROASArdLib roaslib = ROASArdLib;
+
+ROASSetupInfo() {
+const String ROASVersion = "MOST_RECENT_ROAS_VERSION";
+
+int PinsToUseNum[14] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
+const char PinsToUseMode[14] = {OUTPUT, OUTPUT, OUTPUT, INPUT, OUTPUT, INPUT, OUTPUT, INPUT, OUTPUT, INPUT, OUTPUT, INPUT, INPUT, OUTPUT};
+
+}
+
+void setup() {
+roaslib.begin(roaslib);
+roaslib.beginsetup();
+for (int i = 0; i < 14; i++) {
+pinMode(PinsToUseNum[i], PinsToUseMode[i]);
+}
+roaslib.endsetup();
+}
+
+void loop() {
+roaslib.beginloop();
+roaslib.loopsetup();
+roaslib.endloop();
+}


added license info

added license info

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


Added the arduino stuffs back.  Whoops.

Added the arduino stuffs back.  Whoops.

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

--- arduino/onewireProxy/onewireProxy.ino
+++ arduino/onewireProxy/onewireProxy.ino
@@ -0,0 +1,159 @@
+#include <OneWire.h>
+
+OneWire ds(12);
+
+void setup(void) {
+  // initialize inputs/outputs
+  // start serial port
+  Serial.begin(9600);
+}
+
+void romRead(void) {
+      uint8_t someBytes[9];
+    memset(someBytes, 0, sizeof(someBytes));
+    if (ds.reset())
+    {
+      ds.write(0x33);
+      ds.read_bytes(someBytes, sizeof(someBytes));
+    }
+    Serial.write(someBytes, sizeof(someBytes));
+}
+
+void flashRead(void) {
+    uint8_t moreBytes[16];
+    memset(moreBytes, 0, sizeof(moreBytes));
+    if (ds.reset())
+    {
+      ds.write(0xCC);
+      ds.write(0xF0);
+      ds.write(0x00);
+      ds.write(0x00);
+      // Read each byte of 512 and mirror onto prox
+      for( int i = 0; i < 512; i++)
+      {
+        Serial.write(ds.read());
+      }
+    }
+}
+
+void flashWrite(void) {
+      // Write to the Flash
+    // Allocate and clear some ram to buffer into
+    uint8_t newFlash[512];
+    memset(newFlash, 0, sizeof(newFlash));
+
+    //Fill it with data
+    Serial.readBytes((char*) newFlash, sizeof(newFlash));
+
+    // Each loop is a 4 byte chunk
+    uint8_t bytesPerWrite = 8;
+    for( uint16_t offset = 0; offset < (512/bytesPerWrite); offset++)
+    {
+      uint16_t memAddress = offset * bytesPerWrite;
+      // Fail if presense fails
+      if (!ds.reset()) {
+        Serial.write("fp0");
+        return;
+      }
+      ds.write(0xCC); // Skip ROM
+      ds.write(0x0F); // Write Scratch Pad
+
+      // Compute the two byte address
+      uint8_t a1 = (uint8_t) memAddress;
+      uint8_t a2 = (uint8_t) (memAddress >> 8);
+
+      // Write the offset bytes . . . why in this order?!?!?
+      ds.write(a1);
+      ds.write(a2);
+
+      // Fill the 4 byte scratch pad
+      for (uint8_t i = 0; i < bytesPerWrite; i++)
+        ds.write(newFlash[memAddress + i]);
+
+      // Fail if presense fails
+      if (!ds.reset()) {
+        Serial.write("fp1");
+        return;
+      }
+      ds.write(0xCC); // Skip ROM
+      ds.write(0xAA); // Read scratch pad
+
+      // Confirm offset gets mirrored back, otherwise fail
+      if(ds.read() != a1) {
+        Serial.write("fo1");
+        return;
+      }
+      if(ds.read() != a2) {
+        Serial.write("fo2");
+        return;
+      }\
+
+      // Read the confirmation byte, store it
+      uint8_t eaDS = ds.read();
+      // Check the scratchpad contents
+      for (int i = 0; i < bytesPerWrite; i++)
+      {
+        uint8_t verifyByte = ds.read();
+        if ( verifyByte != newFlash[(offset*bytesPerWrite + i)])
+        {
+          Serial.println("fvv");
+          return;
+        }
+      }
+      // Fail if presense fails
+      if (!ds.reset()) {
+        Serial.write("fp2");
+        return;
+      }
+      // Commit the 8 bytes above
+      ds.write(0xCC); // Skip ROM
+      ds.write(0x55); // Copy scratchpad
+
+      // Confirmation bytes
+      ds.write(a1);
+      ds.write(a2);
+      ds.write(eaDS, 1); // Pullup!
+      delay(5); // Wait 5 ms per spec.
+    }
+    Serial.println("t");
+}
+
+
+
+void loop(void) {
+  if (Serial.available() == 0)
+    return;
+
+  int bRead = Serial.read();
+  if (bRead == -1)
+    return;
+  char cmdBuffer = bRead;
+
+  switch (cmdBuffer)
+  {
+  case 'r':       // Read the ROM
+    romRead();
+    break;
+  case 'f':      //  Read the Flash
+    flashRead();
+    break;
+  case 'w':
+    flashWrite();
+    break;
+  case 'x':  // Check   from chip present/absent
+    if (ds.reset())
+      Serial.write("p");
+    else
+      Serial.write("a");
+    break;
+  case 'e':   // Echo
+    Serial.write('e');
+    break;
+  }
+}
+
+
+
+
+
+


Initial Commit

Initial Commit

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

--- reactiongame.ino/reactiongame.ino.ino
+++ reactiongame.ino/reactiongame.ino.ino
@@ -0,0 +1,285 @@
+/*
+ * Title: Reflex Game
+ *
+ * Description: An Arduino based reflex game. Uses 4 lights/buttons
+ * combinations. When the light is on user pushes the corresponding button.
+ * The light turns off and another turns on in random. The game counts how
+ * many the user does correctly in a predifined time (30 secs).
+ * Arduino uses a 4 zone 8x8 LED matrices display driven by MAX7219 to display
+ * the score on the top 2 and the time on the bottom 2.
+ *
+ * Author: Jann Kruse, Nikos Kanelakis, Dimitris Koukoulakis
+ * Licence: General Public Licence (GPL) v3
+ * Company: CommonsLab
+ * Site: http://commonslab.gr
+ * Date: 01/09/2016
+ */
+
+#include <MD_Parola.h>
+#include <MD_MAX72xx.h>
+#if USE_LIBRARY_SPI
+#include <SPI.h>
+#endif
+
+//Use of LED matrix display
+#define USE_LED_SCREEN 1
+
+//Use of Coin Acceptor
+#define USE_COIN_ACCEPTOR 0
+
+//GAME VARIABLES
+#define GAME_TIME 30
+//DEBUG MORE
+#define DEBUG 0 //if set to 1 will print messages on Serial port.
+
+// Define the number of devices we have in the chain and the hardware interface
+// NOTE: These pin numbers will probably not work with your hardware and may
+// need to be adapted
+#define	MAX_DEVICES	4
+#define	MAX_ZONES	  4
+#define UP_MAX_ZONES 2
+#define ZONE_SIZE (MAX_DEVICES/MAX_ZONES)   // integer multiple works best
+
+//Connetion PINS for LED matrix
+#define	CLK_PIN		13
+#define	DATA_PIN	11
+#define	CS_PIN		10
+
+// Hardware SPI connection
+MD_Parola P = MD_Parola(CS_PIN, MAX_DEVICES);
+// Arbitrary output pins
+// MD_Parola P = MD_Parola(DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
+
+// Global variables
+int btn_pins[] = {3,5,7,9};
+int led_pins[] = {2,4,6,8};
+const int MAX_CONNS = 4;
+int buzz_minus = A0;
+int buzz_plus = A3;
+int countdown=GAME_TIME;
+int score = 0; //Loop adds one point first time it runs
+bool game_on = false;
+
+#if USE_LED_SCREEN
+//Digit variables for LED matrix
+int d1 = 0;
+int d2 = 0;
+int d3 = 0;
+int d4 = 0;
+//Used for countdown
+unsigned long currentMillis = 0;
+const long interval = 1000;
+unsigned long previousMillis = 0;
+#endif
+
+int idx = -1;
+
+void setup(void) {
+
+  Serial.begin(9600);
+
+#if USE_LED_SCREEN
+  P.begin(MAX_ZONES);
+  P.setInvert(false);
+  P.setIntensity(8);
+  for (uint8_t i=0; i<MAX_ZONES; i++)
+  {
+    P.setZone(i, ZONE_SIZE*i, (ZONE_SIZE*(i+1))-1);
+  }
+#endif
+
+  for(int i=0; i<MAX_CONNS; i++) {
+    pinMode(led_pins[i], OUTPUT);
+    pinMode(btn_pins[i], INPUT_PULLUP);
+  }
+
+  // Set up the pins for the buzzer:
+  pinMode(buzz_plus, OUTPUT);
+  pinMode(buzz_minus, OUTPUT);
+  digitalWrite(buzz_minus, LOW);    // pull the minus pin to 0 Volt by making it "LOW"
+  Serial.println("Game starting...");
+
+  gameStart();
+}
+void generateRandom()
+{
+  randomSeed(analogRead(A5)*analogRead(A6));
+  for(int i=0; i<10; i++) {
+    int rnd = int(random(MAX_CONNS));
+    if(rnd != idx) {
+      idx = rnd;
+      break;
+    }
+  }
+}
+
+void checkTime()
+{
+  if(currentMillis - previousMillis > interval) {
+    Serial.print("Time:");
+    Serial.println(countdown);
+    previousMillis = currentMillis;
+    #if USE_LED_SCREEN
+      PrintTime();
+    #endif //USE_LED_SCREEN
+  }
+}
+
+void loop(void)
+{
+  while(game_on) {
+    currentMillis = millis();
+
+    //Turn OFF all LEDs
+    clearLeds();
+    //Turn ON the random LED
+    digitalWrite(led_pins[idx], HIGH);
+
+    //Read all the buttons
+    for (int i=0; i < MAX_CONNS; i++) {
+      delay(10);
+      if( (digitalRead(btn_pins[i]) == HIGH) && (i == idx)) {
+        AddPoint();
+        generateRandom();
+        return;
+      } else if (digitalRead(btn_pins[i]) == HIGH) {
+        Error();
+      }
+    }
+
+    checkTime();
+
+    if (countdown < 0) {
+      gameEnd();
+      return;
+    }
+
+  }//while game_on
+}
+
+#if USE_LED_SCREEN
+//Prints 2 digit score to the LED matrix
+void PrintScore() {
+  char c1[2];
+  char c2[2];
+  //Reset score if reaches 100
+  if (score > 99) {
+    score = 0;
+  }
+  //Get last digit
+  d1 = score % 10;
+  //If it has a second digit, get the first one
+  if (score >=10) {
+    d2 = score / 10 % 10;
+  } else {
+    //Set first digit to 0
+    d2 = 0;
+  }
+  //Convert each digit to char array
+  sprintf(c1,"%01d", d1);
+  sprintf(c2,"%01d", d2);
+  //Print each digit to the first two LED matrices
+  P.displayZoneText(0,c1,CENTER,5, 0,PRINT, NO_EFFECT);
+  P.displayZoneText(1,c2,CENTER,5, 0,PRINT, NO_EFFECT);
+  P.displayAnimate();
+}
+#endif //USE_LED_SCREEN
+
+#if USE_LED_SCREEN
+//Print countdown of the game time
+void PrintTime() {
+  char c1[2];
+  char c2[2];
+  //Get last digit
+  d1 = countdown % 10;
+  //If it has a second digit, get the first one
+  if (countdown >= 10) {
+    d2 = countdown / 10 % 10;
+  } else {
+    //Set first digit to 0
+    d2 = 0;
+  }
+  //Convert each digit to char array
+  sprintf(c1,"%01d", d1);
+  sprintf(c2,"%01d", d2);
+  //Print time
+  P.displayZoneText(2,c1,CENTER,5, 0,PRINT, NO_EFFECT);
+  P.displayZoneText(3,c2,CENTER,5, 0,PRINT, NO_EFFECT);
+  P.displayAnimate();
+  //Countdown
+  countdown--;
+}
+#endif //USE_LED_SCREEN
+
+void gameStart() {
+  game_on = true;
+  //Initialize global vars
+  score = 0;
+  countdown = GAME_TIME;
+  //Generate First random number
+  generateRandom();
+  //
+  #if USE_LED_SCREEN
+    P.displayZoneText(0,"0",CENTER,5, 0,PRINT, NO_EFFECT);
+    P.displayZoneText(1,"0",CENTER,5, 0,PRINT, NO_EFFECT);
+    P.displayAnimate();
+    delay(500);
+  #endif
+
+  for(int i=0; i<MAX_CONNS; i++) {
+    digitalWrite(led_pins[i], HIGH);
+  }
+}
+
+void gameEnd() {
+  game_on = false;
+  Serial.println("Game Finished");
+  for(int i=0; i<MAX_CONNS; i++) {
+    digitalWrite(led_pins[i], HIGH);
+  }
+}
+
+void clearLeds() {
+  for(int i=0; i<MAX_CONNS; i++) {
+    digitalWrite(led_pins[i], LOW);
+  }
+}
+
+//User pressed wrong button
+void Error()
+{
+  for (int j=0; j<20; j++) {
+    for (int i=0; i<10; i++) {
+      digitalWrite(buzz_plus, HIGH);
+      delayMicroseconds(200);
+      digitalWrite(buzz_plus, LOW);
+      delayMicroseconds(200);
+    }
+    delay(10);
+    //each loop is 14 millisecs
+  }
+  previousMillis+=280;
+  checkTime();
+  //TODO: Use Led matrix on error?
+}
+
+//User pressed correct button
+void AddPoint()
+{
+  for (int i=0; i<250; i++)
+  {
+    digitalWrite(buzz_plus, HIGH);
+    delayMicroseconds(200);
+    digitalWrite(buzz_plus, LOW);
+    delayMicroseconds(200);
+  }
+  previousMillis+=100;
+  checkTime();
+  score++;
+  Serial.print("Score: ");
+  Serial.println(score);
+  #if USE_LED_SCREEN
+    PrintScore();
+  #endif //USE_LED_SCREEN
+}
+


Initial implementation for manual mode

Initial implementation for manual mode

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/fbatta/wbox-nodejs.git/'


Comment Serial.print. Return plain text instead of JSON for GET requests.

Sketch uses 22,978 bytes (71%) of program storage space. Maximum is 32,256 bytes.
Global variables use 1,185 bytes (57%) of dynamic memory, leaving 863 bytes for local variables. Maximum is 2,048 bytes.

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


Reads in EMG data

Reads in EMG data

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

--- EMGread.ino
+++ EMGread.ino
@@ -0,0 +1,19 @@
+#include <SoftwareSerial.h>
+
+int sensorPin = 0;
+int rawVal = 0;
+float EMGval = 0;
+
+void setup() {
+Serial.begin(9600);
+}
+
+void loop() {
+  rawVal = analogRead(sensorPin);
+  EMGval = rawVal * 4.80 / 1024;
+
+  Serial.println(EMGval);
+
+  delay(300);
+
+}


add comment for QUARTER_STEER_DELAY (obstacle_avoiding.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/nisald/robot_program.git/'


Added servo motor timer changes

Added servo motor timer changes

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

--- CSC_460_-_Jan_22.ino
+++ CSC_460_-_Jan_22.ino
@@ -0,0 +1,208 @@
+//#include <Servo.h>
+
+//Servo servo;
+
+// constants won't change. They're used here to
+// set pin numbers:
+const int button_pin = 2;
+const int servo_x_pin = 0;
+const int servo_out_pin = 9;
+const int IR_pin = 13;
+
+
+// Variables will change:
+int ledState = HIGH;         // the current state of the output pin
+int buttonState;             // the current reading from the input pin
+int lastButtonState = HIGH;   // the previous reading from the input pin
+
+// the following variables are long's because the time, measured in miliseconds,
+// will quickly become a bigger number than can be stored in an int.
+long lastDebounceTime = 0;  // the last time the output pin was toggled
+long debounceDelay = 50;    // the debounce time; increase if the output flickers
+
+volatile int header = 1;
+volatile byte b = 0; // Byte we're trying to transmit
+volatile int i = 7; // Index of byte b we're comparing against.
+
+void setupTimer3(){
+    //Clear timer config.
+  TCCR3A = 0;
+  TCCR3B = 0;
+  //Set to CTC (mode 4)
+  TCCR3B |= (1<<WGM32);
+
+  //Set prescaller to 256
+//  TCCR3B |= (1<<CS32);
+  TCCR3B |= (1<<CS30);
+
+  //Set TOP value (500 us seconds)
+//  OCR3A = 31250;
+   OCR3A = 8000;
+
+//  //Enable interupt A for timer 3.
+//  TIMSK  `3 |= (1<<OCIE3A);
+//  //Set timer to 0 (optional here).
+//  TCNT3 = 0;
+}
+
+void setupPWMTimer(){
+  //PWM
+  //Clear timer config
+  TCCR1A = 0;
+  TCCR1B = 0;
+  TIMSK1 &= ~(1<<OCIE1C);
+  //Set to Fast PWM (mode 15)
+  TCCR1A |= (1<<WGM10) | (1<<WGM11);
+  TCCR1B |= (1<<WGM12) | (1<<WGM13);
+
+  //Enable output C.
+  TCCR1A |= (1<<COM1C1);
+  //No prescaler
+  TCCR1B |= (1<<CS10);
+
+  OCR1A = 410;  //38KHz
+//  OCR1C = 140;  //Target
+  OCR1C = 210;  //Target
+  TCCR1A &= ~(1<<COM1C1); // have the IR transmitter off at first
+}
+
+void setup() {
+  pinMode(button_pin, INPUT);
+  pinMode(servo_x_pin, INPUT);
+  pinMode(servo_out_pin, OUTPUT);
+  pinMode(IR_pin, OUTPUT);
+  Serial.begin(9600);
+
+  // sets pin 9 to ouput
+//  servo.attach(9);
+
+  // debug pins
+  pinMode(10, OUTPUT);
+
+  setupTimer3();
+  setupPWMTimer();
+}
+
+
+// interrupt handler for the IR transmitter
+ISR(TIMER3_COMPA_vect)
+{
+  if(header == 1){
+    // turn on for 500us
+     TCCR1A |= (1<<COM1C1);
+
+     header = 2;
+     return;
+  }else if (header == 2){
+    // turn off for 500us
+    TCCR1A &= ~(1<<COM1C1);
+
+    header = 0;
+    return;
+  }
+
+
+  if( i <= 7){
+    if ((b & (1 << i)) != 0) {
+      // turn on the IRT to transmit a 1
+      TCCR1A |= (1<<COM1C1);
+    } else {
+      // turn off the IRT to transmit 0
+      TCCR1A &= ~(1<<COM1C1);
+    }
+  }
+
+  i += 1;
+
+  // All of byte was transmitted.
+  if (i > 8) {
+    // turn off the IRT
+    TCCR1A &= ~(1<<COM1C1);
+
+    // disable this interrupt
+    TIMSK3 ^= (1<<OCIE3A);
+    TCNT3 = 0;
+
+    // debug
+    digitalWrite(10, LOW);
+  }
+}
+
+void transmit(byte _b) {
+  // debug
+  digitalWrite(10, HIGH);
+
+  // set global values for the interrupt handler
+  b = _b;
+  i = 0;
+  header = 1;
+
+  cli();
+
+  //Enable interupt A for timer 3.
+  TIMSK3 |= (1<<OCIE3A);
+  // Clear interrupt;
+  TIFR3 |= (1<<OCF3A);
+  //Set timer to 0 (optional here).
+  TCNT3 = 0;
+
+  sei();
+}
+
+void loop() {
+  int val;
+
+  // read the state of the switch into a local variable:
+  val = analogRead(button_pin);
+  int reading = LOW;
+  if( val <= 10){
+    reading = LOW;
+  }else{
+    reading = HIGH;
+  }
+
+  // check to see if you just pressed the button
+  // (i.e. the input went from LOW to HIGH),  and you've waited
+  // long enough since the last press to ignore any noise:
+
+  // If the switch changed, due to noise or pressing:
+  if (reading != lastButtonState) {
+    // reset the debouncing timer
+    lastDebounceTime = millis();
+  }
+
+  if ((millis() - lastDebounceTime) > debounceDelay) {
+    // whatever the reading is at, it's been there for longer
+    // than the debounce delay, so take it as the actual current state:
+
+    // if the button state has changed:
+    if (reading != buttonState) {
+      buttonState = reading;
+
+      // only toggle the LED if the new button state is HIGH
+      if (buttonState == HIGH) {
+          transmit(129);
+//        ledState = !ledState;
+      }
+    }
+  }
+
+  // save the rea`ding.  Next time through the loop,
+  // it'll be the lastButtonState:
+  lastButtonState = reading;
+
+
+  // handle input from the servo
+  // read the servo pin value
+  val = analogRead(servo_x_pin);            // reads the value of the potentiometer (value between 0 and 1023)
+//  val = map(val, 0, 1023, 0, 180);     // scale it to use it with the servo (value between 0 and 180)
+  val = map(val, 0, 1024, 500, 2500);     // scale it to use it with the servo (value between 0 and 180)
+
+ //http://www.robotshop.com/blog/en/arduino-5-minute-tutorials-lesson-5-servo-motors-3636
+  digitalWrite(servo_out_pin,HIGH);
+  delayMicroseconds(val);
+  digitalWrite(servo_out_pin,LOW);
+
+//  servo.write(val);
+  delay(15);                           // waits for the servo to get there
+}


added more data to node 433mhz serial messages to the python module

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


COH-54

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


Improves teleporter arduino code.

Improves teleporter arduino code.

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


make a minimal example

make a minimal example

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

--- examples/Demo/Demo.ino
+++ examples/Demo/Demo.ino
@@ -0,0 +1,14 @@
+#include "USBPause.h"
+
+void setup()
+{
+}
+
+void loop()
+{
+  // USB interrupts are enabled here at the beginning of the loop
+  // until the next line where `u` is constructed.
+  USBPause u;
+  // USB interrupts are paused until the end of loop() when `u` is
+  // automatically destructed.
+}


Activador de la EEPROM

Activador de la EEPROM

TODO: Buscar otra opcion para que no haya que activarla cada vez

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

--- test/activar_EEPROM/activar_EEPROM.ino
+++ test/activar_EEPROM/activar_EEPROM.ino
@@ -0,0 +1,59 @@
+// --------------------------------------
+// Habilitar la EEPROM
+//
+
+#include <Wire.h>
+
+#define GPIO 0x20
+
+#define ENABLER 0x2D
+
+#define PASS1 0x43
+#define PASS2 0x4D
+#define PASS3 0x53
+
+#define VALUE 0x02
+
+void setup()
+{
+  Wire.begin();
+
+  Serial.begin(9600);
+  while (!Serial);
+  Serial.println("\nActivando la EEPROM");
+
+  Serial.println("Escribiendo...");
+  Wire.beginTransmission(GPIO);
+  Wire.write((byte)ENABLER);
+  Wire.write((byte)PASS1);
+  Wire.write((byte)PASS2);
+  Wire.write((byte)PASS3);
+  Wire.write((byte)VALUE);
+  int error = Wire.endTransmission();
+
+
+  Serial.print("Acabado con error: ");Serial.println(error);
+
+}
+
+
+void loop()
+{
+  byte rdata = 0xF2;
+
+  Serial.println("Checksum...");
+  Wire.beginTransmission(GPIO);
+  Wire.write(ENABLER);
+
+  int error = Wire.endTransmission();
+  Serial.print("Acabado con error: ");Serial.println(error);
+
+   Wire.requestFrom(GPIO,1);
+    if (Wire.available()){
+      rdata = Wire.read();
+    }
+
+  Serial.print("STATUS RECIBIDO: 0x");Serial.println(rdata,HEX);
+
+  delay(20000);
+}


Use const to save space.

Use const to save space.

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/kdomen/Morse-Code.git/'


Create blend_into_rainbow_v2.ino

Create blend_into_rainbow_v2.ino

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

--- blend_into_rainbow_v2.ino
+++ blend_into_rainbow_v2.ino
@@ -0,0 +1,114 @@
+//***************************************************************
+// Messing with blending moving colors into a cycling rainbow.
+// This started up kind of simple and then I got a little crazy
+// with blending in more stuff.  Gives a great fun visual though
+// on my small matrix.
+//
+// Marc Miller, Oct 2019
+//***************************************************************
+
+#include "FastLED.h"
+#define DATA_PIN    11
+#define CLK_PIN     13
+#define LED_TYPE    LPD8806
+#define COLOR_ORDER GRB
+#define NUM_LEDS    32
+#define BRIGHTNESS  255
+CRGB leds[NUM_LEDS];
+CRGB temp[NUM_LEDS];
+
+uint8_t pos;  // stores a position for color being blended in
+uint8_t posR, posG, posB;  // positions of moving R,G,B dots
+uint8_t hue;  // used to cycle through the rainbow
+uint8_t hue2;  // used to change the moving color
+boolean moving = 1;  // switch for moving/not moving
+
+
+//---------------------------------------------------------------
+void setup() {
+  Serial.begin(115200);  // allows serial monitor output (check baud rate)
+  delay(2500); // startup delay
+  //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();
+  FastLED.show();
+  Serial.println("Setup done. \n");
+}
+
+
+//---------------------------------------------------------------
+void loop() {
+  EVERY_N_MILLISECONDS(60) {
+    hue++;
+  }
+
+  fill_rainbow(leds, NUM_LEDS, hue, 255/NUM_LEDS/4);  // draw part of the rainbow into the strip
+  fadeToBlackBy(leds, NUM_LEDS, 128);  // fade the whole rainbow down some
+
+  EVERY_N_MILLISECONDS(150) {
+    if (moving) {
+      pos++;
+      if (pos == NUM_LEDS) { pos = 0; }  // reset to begining
+    }
+  }
+
+  EVERY_N_MILLISECONDS(5) {
+    if (!moving) {
+      hue2 = hue2 - 1;
+    }
+  }
+
+  CRGB blendThisIn  = CHSV(hue2, 140, 255);  // colors to blend into background
+  CRGB blendThisIn2 = CHSV(hue2, 170, 255);
+  CRGB blendThisIn3 = CHSV(hue2, 210, 255);
+  CRGB blendThisIn4 = CHSV(hue2, 255, 255);
+
+  static uint8_t blendAmount = 128;  // amount of blend  [range: 0-255]
+
+  leds[pos]                   = nblend(leds[pos],                   blendThisIn4, blendAmount/3);
+  leds[mod8(pos+1, NUM_LEDS)] = nblend(leds[mod8(pos+1, NUM_LEDS)], blendThisIn3, blendAmount/2);
+  leds[mod8(pos+2, NUM_LEDS)] = nblend(leds[mod8(pos+2, NUM_LEDS)], blendThisIn2, blendAmount);
+  leds[mod8(pos+3, NUM_LEDS)] = nblend(leds[mod8(pos+3, NUM_LEDS)], blendThisIn,  blendAmount);
+  leds[mod8(pos+4, NUM_LEDS)] = nblend(leds[mod8(pos+4, NUM_LEDS)], blendThisIn2, blendAmount);
+  leds[mod8(pos+5, NUM_LEDS)] = nblend(leds[mod8(pos+5, NUM_LEDS)], blendThisIn3, blendAmount/2);
+  leds[mod8(pos+6, NUM_LEDS)] = nblend(leds[mod8(pos+6, NUM_LEDS)], blendThisIn4, blendAmount/3);
+
+  posR = beatsin8(5, 0, (NUM_LEDS-1));
+  posG = beatsin8(7, 0, (NUM_LEDS-1));
+  posB = beatsin8(9, 0, (NUM_LEDS-1));
+
+  CRGB tempColor = CRGB::Red;
+  temp[posR] = tempColor;
+  tempColor = CRGB::Green;
+  temp[posG] = nblend(temp[posG], tempColor, 128);
+  tempColor = CRGB::Blue;
+  temp[posB] = nblend(temp[posB], tempColor, 128);
+
+  EVERY_N_MILLISECONDS(2) {
+    fadeToBlackBy(temp, NUM_LEDS, 1);  // create fading tail effect
+  }
+
+  for (uint8_t i = 0; i < NUM_LEDS; i++) {
+    leds[i] = nblend(leds[i], temp[i], 128);
+  }
+
+  leds[mod8(posR, NUM_LEDS)]   = nblend(leds[mod8(posR, NUM_LEDS)], CRGB::Red, 90);
+  leds[mod8(posR+1, NUM_LEDS)] = nblend(leds[mod8(posR+1, NUM_LEDS)], CRGB::Red, 128);
+  leds[mod8(posR+2, NUM_LEDS)] = nblend(leds[mod8(posR+2, NUM_LEDS)], CRGB::Red, 90);
+
+  leds[mod8(posG, NUM_LEDS)] =   nblend(leds[mod8(posG, NUM_LEDS)], CRGB::Green, 90);
+  leds[mod8(posG+1, NUM_LEDS)] = nblend(leds[mod8(posG+1, NUM_LEDS)], CRGB::Green, 128);
+  leds[mod8(posG+2, NUM_LEDS)] = nblend(leds[mod8(posG+2, NUM_LEDS)], CRGB::Green, 90);
+
+  leds[mod8(posB, NUM_LEDS)] =   nblend(leds[mod8(posB, NUM_LEDS)], CRGB::Blue, 90);
+  leds[mod8(posB+1, NUM_LEDS)] = nblend(leds[mod8(posB+1, NUM_LEDS)], CRGB::Blue, 128);
+  leds[mod8(posB+2, NUM_LEDS)] = nblend(leds[mod8(posB+2, NUM_LEDS)], CRGB::Blue, 90);
+
+  FastLED.show();  // update the display
+
+  EVERY_N_SECONDS(random8(4, 16)) {
+    moving = !moving;  // randomly start/stop part of the animation for fun
+  }
+
+}// end_main_loop


Create Robocode.ino

Create Robocode.ino

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

--- Robocode.ino
+++ Robocode.ino
@@ -0,0 +1,30 @@
+#include <Servo.h>
+
+Servo servos[6];  // create servo object to control a servo
+                // twelve servo objects can be created on most boards
+char command;
+
+
+void setup()
+{
+  Serial.begin(9600);
+  servos[0].attach(3);
+  servos[1].attach(5);
+  servos[2].attach(6);
+  servos[3].attach(9);
+  servos[4].attach(10);
+  servos[5].attach(11);
+}
+
+void loop()
+{
+  if (Serial.available() > 1) {
+    command = Serial.read();
+    digitalWrite(13, 1);
+    if ( 0 <= command <= 5 ) {
+      servos[command].write(Serial.read());
+    }
+  }
+  digitalWrite(13, 0);
+  delay(5);
+}


IRTester.ino

IRTester.ino

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

--- IRTester/IRTester.ino
+++ IRTester/IRTester.ino
@@ -0,0 +1,223 @@
+//  http://www.pjrc.com/teensy/td_libs_FreqMeasure.html
+#include <FreqMeasure.h>
+
+//  http://www.pjrc.com/teensy/td_libs_FreqCount.html
+#include <FreqCount.h>
+
+#include <U8g2lib.h>
+
+#ifdef U8X8_HAVE_HW_SPI
+#include <SPI.h>
+#endif
+#ifdef U8X8_HAVE_HW_I2C
+#include <Wire.h>
+#endif
+
+// The complete list is available here: https://github.com/olikraus/u8g2/wiki/u8g2setupcpp
+// Please update the pin numbers according to your setup. Use U8X8_PIN_NONE if the reset pin is not connected
+//U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/U8X8_PIN_NONE);
+U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, /* reset=*/U8X8_PIN_NONE);
+
+//#include <U8x8lib.h>
+//
+//#ifdef U8X8_HAVE_HW_SPI
+//#include <SPI.h>
+//#endif
+//
+//U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE);
+
+// freq -> pin D5, pin D8
+
+//  5V----IR_photo--*--10k---D9
+//                  |--1k----D10
+
+// R=max 1K
+//    at 10kohm 37khz is filtered out
+
+#define PIN_1K   10
+#define PIN_10K  9
+#define PIN_ANALOG_DIODE    0
+#define PIN_ANALOG_CALIBRATION 1
+void pull(int pin)
+{
+    pinMode(pin, OUTPUT);
+    digitalWrite(pin, LOW);
+}
+void release(int pin)
+{
+    pinMode(pin, INPUT);
+}
+
+void setup()
+{
+    Serial.begin(9600);
+    Serial.println("begin");
+
+//    u8x8.begin();
+//    u8x8.setPowerSave(0);
+//
+//    u8x8.setFont(u8x8_font_chroma48medium8_r);
+//    u8x8.draw2x2String(0,1,"Hello World!");
+//    for(;;);
+//    u8x8.refreshDisplay();        // for SSD1606/7
+
+    u8g2.begin();
+
+    u8g2.firstPage();
+    do
+    {
+        u8g2.setFont(u8g2_font_ncenB14_tr);
+        u8g2.drawStr(1, 20, "IRTester");
+        u8g2.drawStr(1, 41, "IRTester2");
+        u8g2.drawStr(1, 62, "IRTester3");
+        u8g2.drawFrame(0, 0, 128, 64);
+    } while (u8g2.nextPage());
+
+//    u8g2.clearBuffer();
+//    u8g2.setFont(u8g2_font_ncenB14_tr);
+//    u8g2.drawStr(1, 20, "IRTester");
+//    u8g2.drawStr(1, 41, "IRTester2");
+//    u8g2.drawStr(1, 62, "IRTester3");
+//    u8g2.drawFrame(0, 0, 128, 64);
+//
+//    u8g2.sendBuffer();
+
+//    pull(PIN_10K);
+//    digitalWrite(PIN_10K, HIGH);
+//
+//    delay(100);
+
+//    pull(PIN_10K);
+    pull(PIN_1K);
+
+}
+
+void loop2()
+{
+    float calibr = 0;
+    float a = 0;
+    for (int i = 0; i < 10; i++)
+    {
+        // on 2 serial diodes -> 1.3V
+        calibr += analogRead(PIN_ANALOG_CALIBRATION);
+        a += analogRead(PIN_ANALOG_DIODE);
+    }
+    calibr /= 10;
+    a /= 10;
+    float volt = 1.3 / calibr * (1023.0 - a);
+    int mV = (int) (volt * 1000);
+
+    u8g2.firstPage();
+    do
+    {
+        u8g2.setCursor(1, 20);
+        u8g2.print("Voltage:");
+        u8g2.setCursor(15, 40);
+        u8g2.print(mV);
+        u8g2.print("mV");
+        u8g2.drawFrame(0, 0, 128, 64);
+    } while (u8g2.nextPage());
+
+    Serial.print("a:");
+    Serial.print(a);
+    Serial.print(" cal:");
+    Serial.print(calibr);
+    Serial.print("  V=");
+    Serial.print(mV);
+    Serial.println("mV");
+
+    delay(1000);
+}
+
+void loop3()
+{
+    if (FreqCount.available())
+    {
+        unsigned long count = FreqCount.read();
+        Serial.println(count);
+    }
+    delay(1000);
+}
+
+void loop()
+{
+    float fmax = 0;
+
+    FreqMeasure.begin();
+    delay(500);
+
+    Serial.print("available:");
+    Serial.print(FreqMeasure.available());
+    if (FreqMeasure.available())
+    {
+        Serial.print(" ");
+        int a = FreqMeasure.available();
+        const int istart = 2; // drop first 2, they are random
+        for (int i = 0; i < a; i++)
+        {
+            uint32_t n = FreqMeasure.read();
+            if (i < istart)
+            {
+                continue;
+            }
+            float frequency = FreqMeasure.countToFrequency(n);
+            Serial.print(" (");
+            Serial.print(n);
+            Serial.print(") ");
+            Serial.print(frequency, 0);
+            Serial.print(" ");
+
+            // find shortes pulse width -> max freq
+            if (frequency > fmax)
+                fmax = frequency;
+        }
+    }
+    FreqMeasure.end();
+    Serial.print(" fmax:");
+    Serial.print(fmax, 0);
+
+    const int gate_ms = 1000;
+    FreqCount.begin(gate_ms);
+    delay(1100);
+    unsigned long count = FreqCount.read();
+    FreqCount.end();
+    int perc = 100 * count / fmax;
+//    float fc = 1000.0 * count / gate_ms;
+
+    Serial.print(" count:");
+    Serial.print(count);
+//    Serial.print(" f:");
+//    Serial.print(fc, 0);
+    Serial.print(" perc:");
+    Serial.print(perc);
+    Serial.print("%");
+    Serial.println();
+
+    u8g2.firstPage();
+    do
+    {
+        u8g2.setCursor(1, 20);
+        u8g2.print("f:");
+        if (fmax > 5000)
+        {
+            u8g2.print(fmax / 1000, 0);
+            u8g2.print(" kHz");
+        }
+        else
+        {
+            u8g2.print(fmax, 0);
+            u8g2.print(" Hz");
+        }
+        u8g2.setCursor(1, 40);
+        u8g2.print("count:");
+        u8g2.print(count);
+        u8g2.setCursor(1, 60);
+        u8g2.print("perc:");
+        u8g2.print(perc);
+        u8g2.print("%");
+        u8g2.drawFrame(0, 0, 128, 64);
+    } while (u8g2.nextPage());
+
+//    delay(1000);              // wait for a second
+}
+


initial

initial

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

--- spark.ino
+++ spark.ino
@@ -0,0 +1,215 @@
+// color value storage
+
+int rval = 0;
+int gval = 0;
+int bval = 0;
+
+// color into string storage
+
+char colorStr[64];
+char color[64];
+
+// score into string storage
+
+char scoreStr[64];
+int score = 0;
+
+// velocity into string storage
+
+char velocityStr[64];
+int velocity = 50;
+
+// individual color increments
+
+int r = 0;
+int g = 0;
+int b = 0;
+
+// timekeeping
+
+unsigned long prevMillis = 0;
+unsigned long currentMillis = 0;
+
+// score level ints
+
+const int levelSeven = 150;    // purple
+const int levelSix = 125;    // blue
+const int levelFive = 100;    // aqua
+const int levelFour = 75;    // green
+const int levelThree = 50;    // yellow
+const int levelTwo = 25;    // orange
+const int levelOne = 0;    // red (zero so it starts off red instead of dark)
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////
+// Setup
+////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+void setup() {
+
+	Serial.begin(9600);
+
+	pinMode(A6, OUTPUT);
+	pinMode(A5, OUTPUT);
+	pinMode(A4, OUTPUT);
+
+  // set exposed spark variables
+
+  Spark.variable("rval", &rval, INT);
+  Spark.variable("gval", &gval, INT);
+  Spark.variable("bval", &bval, INT);
+  Spark.variable("score", &score, INT);
+
+  // delays for 20 seconds to give system led time to show connected wifi status (breathing cyan)
+
+  delay(20000);
+
+  // take control of system RGB
+
+  RGB.control(true);
+
+  // set system LED to zero
+
+  RGB.color(rval, gval, bval);
+}
+
+void loop() {
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////
+// add to score to test
+////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+if (score < 500) {
+  score += 3;
+  delay(5000);
+
+  // push score
+
+  sprintf(colorStr, "%s", color);
+  Spark.publish("currentColor", colorStr);
+  sprintf(scoreStr, "%i", score);
+  Spark.publish("currentScore", scoreStr);
+  sprintf(velocityStr, "%i", velocity);
+  Spark.publish("topVelocity", velocityStr);
+
+  // console if needed
+
+  // Serial.println("Score");
+  // Serial.println(score);
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////
+// Check on score once every 5 seconds and update LED
+////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+currentMillis = millis();
+
+if ((currentMillis - prevMillis) >= 5000) {
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////
+// Score to color rules
+////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+// Rules for LevelOne (Red)
+
+if (((score >= levelOne) && (score < levelTwo)) && ( rval != 255 )) {
+  for (int r=0; r <= 255; r++) {
+    RGB.color(rval, gval, bval);
+    rval = r;
+    delay(20);
+    prevMillis = currentMillis;
+    strcpy(color, "Red!");
+  }
+}
+
+// Rules for LevelTwo (Orange)
+
+else if (((score >= levelTwo) && (score < levelThree)) && (gval != 40) ) {
+  for (int g=0; g <= 40; g++) {
+    RGB.color(rval, gval, bval);
+    gval = g;
+    delay(20);
+    prevMillis = currentMillis;
+    strcpy(color, "Orange!");
+  }
+}
+
+// Rules for LevelThree (Yellow)
+
+else if (((score >= levelThree) && (score < levelFour)) && (gval != 140) ) {
+  for (int g=40; g <= 140; g++) {
+    RGB.color(rval, gval, bval);
+    gval = g;
+    delay(20);
+    prevMillis = currentMillis;
+    strcpy(color, "Yellow!");
+  }
+}
+
+// Rules for LevelFour (Green)
+
+else if (((score >= levelFour) && (score < levelFive)) && (gval != 255) ) {
+  for (int g=140; g <= 255; g++) {
+    RGB.color(rval, gval, bval);
+    gval = g;
+    delay(20);
+    prevMillis = currentMillis;
+    strcpy(color, "Green!");
+  }
+  for (int r=255; r >= 0; r--) {
+    RGB.color(rval, gval, bval);
+    rval = r;
+    delay(20);
+    prevMillis = currentMillis;
+  }
+}
+
+// Rules for LevelFive (Aqua)
+
+else if (((score >= levelFive) && (score < levelSix)) && (bval != 253) ) {
+  for (int b=0; b <= 253; b++) {
+    RGB.color(rval, gval, bval);
+    bval = b;
+    delay(20);
+    prevMillis = currentMillis;
+    strcpy(color, "Aqua!");
+  }
+}
+
+// Rules for LevelSix (Blue)
+
+else if (((score >= levelSix) && (score < levelSeven)) && (bval != 254) ) {
+  for (int b=253; b <= 254; b++) {
+    RGB.color(rval, gval, bval);
+    bval = b;
+    delay(20);
+    prevMillis = currentMillis;
+    strcpy(color, "Blue!");
+  }
+  for (int g=255; g >= 0; g--) {
+    RGB.color(rval, gval, bval);
+    gval = g;
+    delay(20);
+    prevMillis = currentMillis;
+  }
+}
+
+// Rules for LevelSeven (Purple)
+
+else if ((score >= levelSeven) && (bval != 255)) {
+  for (int b=254; b <= 255; b++) {
+    RGB.color(rval, gval, bval);
+    bval = b;
+    delay(20);
+    prevMillis = currentMillis;
+    strcpy(color, "Purple!");
+  }
+  for (int r=0; r <= 105; r++) {
+    RGB.color(rval, gval, bval);
+    rval = r;
+    delay(20);
+    prevMillis = currentMillis;
+  }
+
+}
+}
+}


Delete A_printertest_mod.ino

Delete A_printertest_mod.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/rollasoul/toku.git/'


Initial version

Initial version

Arduino Bluetooth Low Energy demonstration sketch

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

--- BLE_Generic_Read_Write/BLE_Generic_Read_Write.ino
+++ BLE_Generic_Read_Write/BLE_Generic_Read_Write.ino
@@ -0,0 +1,271 @@
+// Arduino Bluetooth Low Energy demonstration sketch
+// GAP Slave (aka Peripheral) - GATT Server
+// 03-22-2015 by Jim Wootten
+// Updates should be available at https://github.com/TBD
+//
+// Changelog:
+//      03-22-2015 - Initial release
+
+/* ============================================
+ Arduino Bluetooth Low Energy code is placed under the MIT license
+ Copyright (c) 2015 Jim Wootten
+
+ 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.
+ ===============================================
+ */
+
+// uncomment this line for Serial.println() debug output
+//#define DEBUG
+
+#include <SoftwareSerial.h>
+#include "BGLib.h"
+
+// BLE112 module connections:
+// - BLE P0_4  -> Arduino Digital Pin 2 (BLE TX -> Arduino soft RX)
+// - BLE P0_5  -> Arduino Digital Pin 3 (BLE RX -> Arduino soft TX)
+// - BLE Reset -> Arduino Digital Pin 4  (BLE Reset -> Arduino I/O 4)
+// or via solder pad jumpers on Arduino Bluetooth Low Energy shield
+// - BLE P0_4  -> Arduino Digital Pin 10 (BLE TX -> Arduino soft RX)
+// - BLE P0_5  -> Arduino Digital Pin 11 (BLE RX -> Arduino soft TX)
+// - BLE Reset -> Arduino Digital Pin 12 (BLE Reset -> Arduino I/O 12)
+//
+// - Arduino Bluetooth Low Energy Shield LED1 -> BLE P0_0 (turn on/off via BGLib)
+//
+
+#define ARDUINO_RX_PIN  2  // Arduino software serial port - RX
+#define ARDUINO_TX_PIN  3  // Arduino software serial port - TX
+#define BLE_RESET_PIN   4  // BLE Shield Reset
+#define ARDUINO_LED_PIN 13  // Arduino Uno LED
+#define ARDUINO_SPEED 38400 // Arduino hardware serial port speed (baud rate) for the serial communication to PC
+#define BLE_SPEED     19200 // Arduino software serial port speed (baud rate) for the serial communication to BLE Shield
+#define GATT_HANDLE_C_RX_DATA   32  // supports "write" operation
+#define GATT_HANDLE_C_TX_DATA   36  // supports "read" and "indicate" operations
+
+SoftwareSerial bleSerialPort(ARDUINO_RX_PIN, ARDUINO_TX_PIN); // receive, transmit
+BGLib ble112((HardwareSerial *)&bleSerialPort, 0, 1); // Initialize Bluegiga's BGLib
+
+void setup() {
+  // open Arduino USB serial (and wait, if we're using Leonardo)
+  Serial.begin(ARDUINO_SPEED);
+  while (!Serial);
+
+  // welcome!
+  Serial.println(F("\n\nArduino Bluetooth Low Energy Demo\n"));
+
+  // initialize Arduino status LED and turn it off
+  pinMode(ARDUINO_LED_PIN, OUTPUT);
+  digitalWrite(ARDUINO_LED_PIN, LOW);
+
+  // set the data rate for the SoftwareSerial port
+  bleSerialPort.begin(BLE_SPEED);
+
+  // set up internal status handlers
+  ble112.onBusy = onBusy;
+  ble112.onIdle = onIdle;
+  ble112.onTimeout = onTimeout;
+
+  // set up BGLib response handlers (called almost immediately after sending commands)
+  ble112.ble_rsp_system_hello = my_rsp_system_hello;
+
+  // set up BGLib event handlers (called at unknown times)
+  ble112.ble_evt_system_boot = my_evt_system_boot;
+  ble112.ble_evt_attributes_value = my_ble_evt_attributes_value;
+
+  // reset the BLE112
+  pinMode(BLE_RESET_PIN, OUTPUT);
+  digitalWrite(BLE_RESET_PIN, LOW);
+  delay(100); // wait 100ms
+  digitalWrite(BLE_RESET_PIN, HIGH);
+  delay(1000); // wait 500ms
+
+  // configure BLE112 io ports and turn shield LED off
+  setupBLE112();
+}
+
+void setupBLE112() {
+  // turn shield LED off
+  ble112.ble_cmd_hardware_io_port_config_direction(0, 0x09); // configure port 0 bits 0 and 4 as output
+  while (ble112.checkActivity(1000)); // response should come back within milliseconds
+  ble112.ble_cmd_hardware_io_port_write(0, 0x01, 0x00); // set port 0 pin 0 to low
+  while (ble112.checkActivity(1000)); // response should come back within milliseconds
+}
+
+void loop() {
+  displayMenu();
+  while (1) {
+    // check for software serial overflow
+    if (bleSerialPort.overflow()) {
+      Serial.println(F("\n!!! SoftwareSerial overflow!"));
+    }
+
+    // keep polling for new data from BLE112
+    ble112.checkActivity();
+
+    // check for input from the user
+    if (Serial.available()) {
+      uint8_t ch = Serial.read();
+      if (ch == '0') {
+        // hardware reset BLE112
+        Serial.println(F("--> hardware reset"));
+        digitalWrite(BLE_RESET_PIN, LOW);
+        delay(100); // wait 100ms
+        digitalWrite(BLE_RESET_PIN, HIGH);
+        delay(1000); // wait 500ms
+        // configure BLE112 io ports and turn shield LED off
+        setupBLE112();
+      }
+      else if (ch == '1') {
+        // say hello to the BLE112 and wait for response
+        Serial.println(F("--> system hello"));
+        ble112.ble_cmd_system_hello();
+        while (ble112.checkActivity(1000)); // response should come back within milliseconds
+      }
+      else if (ch == '2') {
+        // start advertising general discoverable / undirected connectable
+        Serial.println(F("--> start advertising"));
+        ble112.ble_cmd_gap_set_mode(BGLIB_GAP_GENERAL_DISCOVERABLE, BGLIB_GAP_UNDIRECTED_CONNECTABLE);
+        while (ble112.checkActivity(1000)); // response should come back within milliseconds
+      }
+      else if (ch == '3') {
+        // write data
+        Serial.println(F("--> write data: "));
+        uint8 write_data[] = {'T', 'e', 's', 't'};
+        ble112.ble_cmd_attributes_write( GATT_HANDLE_C_RX_DATA, 0, sizeof(write_data), write_data);
+        while (ble112.checkActivity(1000)); // response should come back within milliseconds
+       }
+      else if (ch == '4') {
+        // read data
+        Serial.println(F("--> read data is done automatically by callback function my_ble_evt_attributes_value()"));
+      }
+      else if (ch == '5') {
+        // stop advertising
+        Serial.println(F("--> stop advertising"));
+        ble112.ble_cmd_gap_set_mode(BGLIB_GAP_NON_DISCOVERABLE, BGLIB_GAP_NON_CONNECTABLE);
+        while (ble112.checkActivity(1000)); // response should come back within milliseconds
+      }
+      else if (ch == '6') {
+        // turn shield LED on
+        Serial.println(F("--> LED on"));
+        ble112.ble_cmd_hardware_io_port_write(0, 0x01, 0x1); // set port 0 pin 0 to high
+        while (ble112.checkActivity(1000)); // response should come back within milliseconds
+      }
+      else if (ch == '7') {
+        // turn shield LED off
+        Serial.println(F("--> LED off"));
+        ble112.ble_cmd_hardware_io_port_write(0, 0x01, 0x00); // set port 0 pin 0 to low
+        while (ble112.checkActivity(1000)); // response should come back within milliseconds
+      }
+      else if (ch == '8') {
+        // get amount of free RAM on Arduino
+        Serial.print(F("--> Free Ram: "));
+        Serial.print(freeRam());
+        Serial.println(F(" bytes"));
+      }
+      displayMenu();
+    }
+  }
+}
+
+void displayMenu() {
+  Serial.println(F("\nOperations Menu:"));
+  Serial.println(F("0) Reset BLE112 module"));
+  Serial.println(F("1) Say hello to the BLE112 and wait for response"));
+  Serial.println(F("2) Start advertising"));
+  Serial.println(F("3) Write data"));
+  Serial.println(F("4) Read data"));
+  Serial.println(F("5) Stop advertising"));
+  Serial.println(F("6) Turn on  BLE112 Arduino Shield LED1"));
+  Serial.println(F("7) Turn off BLE112 Arduino Shield LED1"));
+  Serial.println(F("8) Get amount of free RAM on Arduino"));
+  Serial.println(F("Command?\n"));
+}
+
+int freeRam () {
+  extern int __heap_start, *__brkval;
+  int v;
+  return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
+}
+
+// ================================================================
+// INTERNAL BGLIB CLASS CALLBACK FUNCTIONS
+// ================================================================
+
+void onBusy() {
+  // turn LED on when we're busy
+  digitalWrite(ARDUINO_LED_PIN, HIGH);
+}
+
+void onIdle() {
+  // turn LED off when we're no longer busy
+  digitalWrite(ARDUINO_LED_PIN, LOW);
+}
+
+void onTimeout() {
+  Serial.println(F("\n!!! Timeout occurred!"));
+}
+
+// ================================================================
+// USER-DEFINED BGLIB RESPONSE CALLBACKS
+// ================================================================
+
+void my_rsp_system_hello(const ble_msg_system_hello_rsp_t *msg) {
+  Serial.println(F("<-- system hello"));
+}
+
+// ================================================================
+// USER-DEFINED BGLIB EVENT CALLBACKS
+// ================================================================
+
+void my_evt_system_boot(const ble_msg_system_boot_evt_t *msg) {
+  Serial.print(F("### BLE112 system boot: { "));
+  Serial.print(F("Software version: "));
+  Serial.print(msg -> major, HEX);
+  Serial.print(F("."));
+  Serial.print(msg -> minor, HEX);
+  Serial.print(F("."));
+  Serial.print(msg -> patch, HEX);
+  Serial.print(F("."));
+  Serial.print(msg -> build, HEX);
+  Serial.print(F(", Link layer version: "));     Serial.print(msg -> ll_version, HEX);
+  Serial.print(F(", BGAPI protocol version: ")); Serial.print(msg -> protocol_version, HEX);
+  Serial.print(F(", Hardware version: "));       Serial.print(msg -> hw, HEX);
+  Serial.println(F(" }"));
+}
+
+// Callback function is triggered by a write to attributes database
+//
+void my_ble_evt_attributes_value(const struct ble_msg_attributes_value_evt_t *msg) {
+        Serial.println(F("### Data read:"));
+        Serial.print(F("    { "));
+        Serial.print(F("connection: "));  Serial.print(msg -> connection, HEX);
+        Serial.print(F(", reason: "));    Serial.print(msg -> reason, HEX);
+        Serial.print(F(", handle: "));    Serial.print(msg -> handle, HEX);
+        Serial.print(F(", offset: "));    Serial.print(msg -> offset, HEX);
+        Serial.print(F(", value_len: ")); Serial.print(msg -> value.len, HEX);
+        Serial.print(F(", value_data: "));
+        // this is a "uint8array" data type, which is a length byte and a uint8_t* pointer
+        for (uint8_t i = 0; i < msg -> value.len; i++) {
+            if (msg -> value.data[i] < 16) Serial.write('0');
+            Serial.print(msg -> value.data[i], HEX);
+        }
+        Serial.println(F(" }"));
+}
+
+
+


First non-working skeleton

First non-working skeleton

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

--- Esp8266GatewayPimatic.ino
+++ Esp8266GatewayPimatic.ino
@@ -0,0 +1,196 @@
+/**
+ *
+ * This is for mysensors 2.0
+ * Compile this one with the 2.0 mysensors library
+ *
+ * The MySensors Arduino library handles the wireless radio link and protocol
+ * between your home built sensors/actuators and HA controller of choice.
+ * The sensors forms a self healing radio network with optional repeaters. Each
+ * repeater and gateway builds a routing tables in EEPROM which keeps track of the
+ * network topology allowing messages to be routed to nodes.
+ *
+ * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
+ * Copyright (C) 2013-2015 Sensnology AB
+ * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
+ *
+ * Documentation: http://www.mysensors.org
+ * Support Forum: http://forum.mysensors.org
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ *******************************
+ *
+ * REVISION HISTORY
+ * Version 1.0 - Henrik EKblad
+ * Contribution by a-lurker and Anticimex,
+ * Contribution by Norbert Truchsess <norbert.truchsess@t-online.de>
+ * Contribution by Ivo Pullens (ESP8266 support)
+ *
+ * DESCRIPTION
+ * The EthernetGateway sends data received from sensors to the WiFi link.
+ * The gateway also accepts input on ethernet interface, which is then sent out to the radio network.
+ *
+ * VERA CONFIGURATION:
+ * Enter "ip-number:port" in the ip-field of the Arduino GW device. This will temporarily override any serial configuration for the Vera plugin.
+ * E.g. If you want to use the defualt values in this sketch enter: 192.168.178.66:5003
+ *
+ * LED purposes:
+ * - To use the feature, uncomment WITH_LEDS_BLINKING in MyConfig.h
+ * - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved
+ * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
+ * - ERR (red) - fast blink on error during transmission error or recieve crc error
+ *
+ * See http://www.mysensors.org/build/esp8266_gateway for wiring instructions.
+ * nRF24L01+  ESP8266
+ * VCC        VCC
+ * CE         GPIO4
+ * CSN/CS     GPIO15
+ * SCK        GPIO14
+ * MISO       GPIO12
+ * MOSI       GPIO13
+ * GND        GND
+ *
+ * Not all ESP8266 modules have all pins available on their external interface.
+ * This code has been tested on an ESP-12 module.
+ * The ESP8266 requires a certain pin configuration to download code, and another one to run code:
+ * - Connect REST (reset) via 10K pullup resistor to VCC, and via switch to GND ('reset switch')
+ * - Connect GPIO15 via 10K pulldown resistor to GND
+ * - Connect CH_PD via 10K resistor to VCC
+ * - Connect GPIO2 via 10K resistor to VCC
+ * - Connect GPIO0 via 10K resistor to VCC, and via switch to GND ('bootload switch')
+ *
+  * Inclusion mode button:
+ * - Connect GPIO5 via switch to GND ('inclusion switch')
+ *
+ * Hardware SHA204 signing is currently not supported!
+ *
+ * Make sure to fill in your ssid and WiFi password below for ssid & pass.
+ */
+
+#include <EEPROM.h>
+#include <SPI.h>
+
+// Enable debug prints to serial monitor
+#define MY_DEBUG
+
+// Use a bit lower baudrate for serial prints on ESP8266 than default in MyConfig.h
+#define MY_BAUD_RATE 9600
+
+// Enables and select radio type (if attached)
+#define MY_RADIO_NRF24
+//#define MY_RADIO_RFM69
+
+#define MY_GATEWAY_ESP8266
+
+#define MY_ESP8266_SSID "MySSID"
+#define MY_ESP8266_PASSWORD "MyVerySecretPassword"
+
+// Enable UDP communication
+//#define MY_USE_UDP
+
+// Set the hostname for the WiFi Client. This is the hostname
+// it will pass to the DHCP server if not static.
+// #define MY_ESP8266_HOSTNAME "sensor-gateway"
+
+// Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
+//#define MY_IP_ADDRESS 192,168,178,87
+
+// If using static ip you need to define Gateway and Subnet address as well
+#define MY_IP_GATEWAY_ADDRESS 192,168,178,1
+#define MY_IP_SUBNET_ADDRESS 255,255,255,0
+
+// The port to keep open on node server mode
+#define MY_PORT 5003
+
+// How many clients should be able to connect to this gateway (default 1)
+#define MY_GATEWAY_MAX_CLIENTS 2
+
+// Controller ip address. Enables client mode (default is "server" mode).
+// Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere.
+//#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 68
+
+// Enable inclusion mode
+#define MY_INCLUSION_MODE_FEATURE
+
+// Enable Inclusion mode button on gateway
+// #define MY_INCLUSION_BUTTON_FEATURE
+// Set inclusion mode duration (in seconds)
+#define MY_INCLUSION_MODE_DURATION 60
+// Digital pin used for inclusion mode button
+#define MY_INCLUSION_MODE_BUTTON_PIN  3
+
+
+// Flash leds on rx/tx/err
+// #define MY_LEDS_BLINKING_FEATURE
+// Set blinking period
+// #define MY_DEFAULT_LED_BLINK_PERIOD 300
+
+// Led pins used if blinking feature is enabled above
+#define MY_DEFAULT_ERR_LED_PIN 16  // Error led pin
+#define MY_DEFAULT_RX_LED_PIN  16  // Receive led pin
+#define MY_DEFAULT_TX_LED_PIN  16  // the PCB, on board LED
+
+#if defined(MY_USE_UDP)
+  #include <WiFiUDP.h>
+#else
+  #include <ESP8266WiFi.h>
+#endif
+
+#include <MySensors.h>
+
+void setup() {
+}
+
+void presentation() {
+  // Present locally attached sensors here
+}
+
+
+void loop() {
+  // Send locally attached sensors data here
+}
+
+void incomingMessageESP(const MyMessage &message) {
+  String yourdata;
+   char yourvariable[10];
+
+  // Pass along the message from sensors to serial line
+  serial(PSTR("%d;%d;%d;%d;%d;%s\n"),message.sender, message.sensor, mGetCommand(message), mGetAck(message), message.type, message.getString(convBuf));
+  Serial.print("Node-Sensor (variable to use in pimatic) ");Serial.print(message.sender);Serial.print("-");Serial.print(message.sensor);Serial.print("; Value ");Serial.println(message.getString(convBuf));
+
+  char host_char_array[pim_host.length()+1];
+  pim_host.toCharArray(host_char_array,pim_host.length()+1);
+
+  if (!client.connect(host_char_array, pim_port)) {
+    Serial.println("connection failed");
+    return;
+  }
+
+  // calculate Base64Login
+  memset(authVal,0,40);
+  (pim_user + String(":") + pim_pass).toCharArray(authVal, 40);
+  memset(authValEncoded,0,40);
+  base64_encode(authValEncoded, authVal, (pim_user + String(":") + pim_pass).length());
+
+
+  //Send Value received from node
+  yourdata = "{\"type\": \"value\", \"valueOrExpression\": \"" + String(message.getString(convBuf)) + "\"}";
+  sprintf(yourvariable, "%d-%d",message.sender,message.sensor);
+
+    client.print("PATCH /api/variables/");
+    client.print(yourvariable);
+    client.print(" HTTP/1.1\r\n");
+    client.print("Authorization: Basic ");
+    client.print(authValEncoded);
+    client.print("\r\n");
+    client.print("Host: " + pim_host +"\r\n");
+    client.print("Content-Type:application/json\r\n");
+    client.print("Content-Length: ");
+    client.print(yourdata.length());
+    client.print("\r\n\r\n");
+    client.print(yourdata);
+
+}
+


Add example sketch for interfacing the two radio-equipped Arduinos.

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

--- Calibration/pingPair/pingPair.ino
+++ Calibration/pingPair/pingPair.ino
@@ -0,0 +1,210 @@
+/*
+ Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ version 2 as published by the Free Software Foundation.
+ */
+
+#include <SPI.h>
+#include "nRF24L01.h"
+#include "RF24.h"
+#include "printf.h"
+
+//
+// Hardware configuration
+//
+
+// Set up nRF24L01 radio on SPI bus plus pins 9 & 10
+
+RF24 radio(9,10);
+
+// sets the role of this unit in hardware.  Connect to GND to be the 'pong' receiver
+// Leave open to be the 'ping' transmitter
+const int role_pin = 7;
+
+//
+// Topology
+//
+
+// Radio pipe addresses for the 2 nodes to communicate.
+const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };
+
+//
+// Role management
+//
+// Set up role.  This sketch uses the same software for all the nodes
+// in this system.  Doing so greatly simplifies testing.  The hardware itself specifies
+// which node it is.
+//
+// This is done through the role_pin
+//
+
+// The various roles supported by this sketch
+typedef enum { role_ping_out = 1, role_pong_back } role_e;
+
+// The debug-friendly names of those roles
+const char* role_friendly_name[] = { "invalid", "Ping out", "Pong back"};
+
+// The role of the current running sketch
+role_e role;
+
+void setup(void)
+{
+  //
+  // Role
+  //
+
+  // set up the role pin
+  pinMode(role_pin, INPUT);
+  digitalWrite(role_pin,HIGH);
+  delay(20); // Just to get a solid reading on the role pin
+
+  // read the address pin, establish our role
+  if ( ! digitalRead(role_pin) )
+    role = role_ping_out;
+  else
+    role = role_pong_back;
+
+  //
+  // Print preamble
+  //
+
+  Serial.begin(57600);
+  printf_begin();
+  printf("\n\rRF24/examples/pingpair/\n\r");
+  printf("ROLE: %s\n\r",role_friendly_name[role]);
+
+  //
+  // Setup and configure rf radio
+  //
+
+  radio.begin();
+
+  // optionally, increase the delay between retries & # of retries
+  radio.setRetries(15,15);
+
+  // optionally, reduce the payload size.  seems to
+  // improve reliability
+  radio.setPayloadSize(8);
+
+  //
+  // Open pipes to other nodes for communication
+  //
+
+  // This simple sketch opens two pipes for these two nodes to communicate
+  // back and forth.
+  // Open 'our' pipe for writing
+  // Open the 'other' pipe for reading, in position #1 (we can have up to 5 pipes open for reading)
+
+  if ( role == role_ping_out )
+  {
+    radio.openWritingPipe(pipes[0]);
+    radio.openReadingPipe(1,pipes[1]);
+  }
+  else
+  {
+    radio.openWritingPipe(pipes[1]);
+    radio.openReadingPipe(1,pipes[0]);
+  }
+
+  //
+  // Start listening
+  //
+
+  radio.startListening();
+
+  //
+  // Dump the configuration of the rf unit for debugging
+  //
+
+  radio.printDetails();
+}
+
+void loop(void)
+{
+  //
+  // Ping out role.  Repeatedly send the current time
+  //
+
+  if (role == role_ping_out)
+  {
+    // First, stop listening so we can talk.
+    radio.stopListening();
+
+    // Take the time, and send it.  This will block until complete
+    unsigned long time = millis();
+    printf("Now sending %lu...",time);
+    bool ok = radio.write( &time, sizeof(unsigned long) );
+
+    if (ok)
+      printf("ok...");
+    else
+      printf("failed.\n\r");
+
+    // Now, continue listening
+    radio.startListening();
+
+    // Wait here until we get a response, or timeout (250ms)
+    unsigned long started_waiting_at = millis();
+    bool timeout = false;
+    while ( ! radio.available() && ! timeout )
+      if (millis() - started_waiting_at > 200 )
+        timeout = true;
+
+    // Describe the results
+    if ( timeout )
+    {
+      printf("Failed, response timed out.\n\r");
+    }
+    else
+    {
+      // Grab the response, compare, and send to debugging spew
+      unsigned long got_time;
+      radio.read( &got_time, sizeof(unsigned long) );
+
+      // Spew it
+      printf("Got response %lu, round-trip delay: %lu\n\r",got_time,millis()-got_time);
+    }
+
+    // Try again 1s later
+    delay(1000);
+  }
+
+  //
+  // Pong back role.  Receive each packet, dump it out, and send it back
+  //
+
+  if ( role == role_pong_back )
+  {
+    // if there is data ready
+    if ( radio.available() )
+    {
+      // Dump the payloads until we've gotten everything
+      unsigned long got_time;
+      bool done = false;
+      while (!done)
+      {
+        // Fetch the payload, and see if this was the last one.
+        done = radio.read( &got_time, sizeof(unsigned long) );
+
+        // Spew it
+        printf("Got payload %lu...",got_time);
+
+        // Delay just a little bit to let the other unit
+        // make the transition to receiver
+        delay(20);
+      }
+
+      // First, stop listening so we can talk
+      radio.stopListening();
+
+      // Send the final one back.
+      radio.write( &got_time, sizeof(unsigned long) );
+      printf("Sent response.\n\r");
+
+      // Now, resume listening so we catch the next packets.
+      radio.startListening();
+    }
+  }
+}


Memsic2125

Memsic2125

joystick acceleration

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

--- Memsic2125/Memsic2125.ino
+++ Memsic2125/Memsic2125.ino
@@ -0,0 +1,42 @@
+/*
+  Memsic2125
+
+  Reads input from a Memsic 2125 two-axis accelerometer.
+  Converts pulse outputs into acceleration in milli-g's
+  (1/1000 of earth's gravity) and prints them out.
+
+  Patrick Kubiak
+ */
+
+// definitions
+const int joyX = 2;    // x output of accelerometer
+const int joyY = 3;    // y output of accelerometer
+
+// setup
+void setup() {
+  // initialize accelerometer input
+  pinMode(joyX, INPUT);
+  pinMode(joyY, INPUT);
+
+  // initialize serial communication at 9600 bits per second
+  Serial.begin(9600);
+}
+
+// loop forever
+void loop() {
+  int pulseX, pulseY;  // store pulse widths
+  int accelX, accelY;  // store accelerations
+
+  // read X and Y pulse
+  pulseX = pulseIn(joyX, HIGH);
+  pulseY = pulseIn(joyY, HIGH);
+
+  // convery pulse width to acceleration in milli-g's
+  // earth's gravtiy is 1000 milli-g's, or 1g
+  accelX = ((pulseX / 10) - 500) * 8;
+  accelY = ((pulseY / 10) - 500) * 8;
+
+  // display acceleration
+  Serial.println("X = " + String(accelX) + "\t Y = " + String(accelY));
+  delay(100);
+}


comment :|

comment :|

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


Inital commit of FlappingMachine.ino

Inital commit of FlappingMachine.ino

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

--- src/FlappingMaching.ino
+++ src/FlappingMaching.ino
@@ -0,0 +1,124 @@
+#include <Me_BaseShield.h>
+#include <Me_InfraredReceiver.h>
+#include <Me_UltrasonicSensor.h>
+#include "MakeblockStepper.h"
+#include <Servo.h>
+#include <Me_ServoDriver.h>
+
+// Finite state machine
+
+#define STATE_OFF 0
+#define STATE_WAIT_FOR_ITEM 1
+#define STATE_MOVE_ITEM_IN 2
+#define STATE_STOP_ITEM 3
+#define STATE_PULL_BACK_FLAP 4
+#define STATE_LOWER_TOP_FLAP 5
+#define STATE_RELEASE_FLAP 6
+#define STATE_RAISE_TOP_FLAP 7
+#define STATE_MOVE_ITEM_OUT 8
+
+int fsmState;
+
+Me_BaseShield baseShield;
+Me_InfraredReceiver infraredReceiver; /* Note: As the code need to use interrupt 0, it works only when the Me - Infrared Receiver module is connected to the port 4(PORT_4) of Me - Base Shield. */
+Me_UltrasonicSensor ultraSensor( PORT_5 ); //Ultrasonic module can ONLY be connected to port 3, 4, 5, 6, 7, 8 of base shield. ultraSensor.distanceCm()
+MakeblockStepper moveItemStepper( 3200, baseShield, PORT_3 );
+Me_ServoDriver servoDriver(PORT_2); //can ONLY be PORT_1,PORT_2
+
+void setup() {
+  // Initailize FSM
+  fsmState = STATE_OFF;
+
+  // Initialize communications
+  Serial.begin(9600);
+
+  // Initialize components
+  baseShield.begin();
+  infraredReceiver.begin();
+  ultraSensor.begin();
+  moveItemStepper.setSpeed( 12 );
+  servoDriver.Servo1_begin();
+  servoDriver.writeServo1( 90 );
+}
+
+void loop() {
+  int remoteKey = infraredReceiver.read();
+  int usDistance = ultraSensor.distanceCm();
+  int stopMicroSwitch = baseShield.readMePortOutsidePin( PORT_8 );
+
+  switch ( fsmState ) {
+    case STATE_OFF:
+      Serial.println( "OFF" );
+      if ( remoteKey == IR_POWER_BUTTON ) {
+        fsmState = STATE_WAIT_FOR_ITEM;
+      }
+      break;
+
+    case STATE_WAIT_FOR_ITEM:
+      Serial.println( "WAIT FOR ITEM" );
+      Serial.println( "usDistance = ");
+      Serial.println( usDistance );
+      Serial.println( "stopMicroSwitch = ");
+      Serial.println( stopMicroSwitch );
+      delay( 200 );
+      if ( usDistance < 6 && stopMicroSwitch == HIGH ) {
+        moveItemStepper.step( -100 );
+        fsmState = STATE_MOVE_ITEM_IN;
+      }
+      break;
+
+    case STATE_MOVE_ITEM_IN:
+      Serial.println( "MOVE ITEM IN" );
+      Serial.println( "stopMicroSwitch = ");
+      Serial.println( stopMicroSwitch );
+      if ( usDistance < 6 && stopMicroSwitch == HIGH ) {
+        moveItemStepper.step( -100 );
+        fsmState = STATE_MOVE_ITEM_IN;
+      } else if ( stopMicroSwitch == LOW ) {
+        fsmState = STATE_PULL_BACK_FLAP;
+      }
+      break;
+
+    case STATE_PULL_BACK_FLAP:
+      Serial.println( "PULL BACK FLAP" );
+      if ( stopMicroSwitch == LOW ) {
+        moveItemStepper.step( -300 );
+        fsmState = STATE_LOWER_TOP_FLAP;
+      }
+      break;
+
+    case STATE_LOWER_TOP_FLAP:
+      Serial.println( "LOWER TOP FLAP" );
+      servoDriver.writeServo1( 50 );
+      delay( 1000 );
+      fsmState = STATE_RELEASE_FLAP;
+    break;
+
+    case STATE_RELEASE_FLAP:
+      Serial.println( "RELEASE FLAP" );
+      moveItemStepper.step( 300 );
+      fsmState = STATE_RAISE_TOP_FLAP;
+      break;
+
+    case STATE_RAISE_TOP_FLAP:
+      Serial.println( "RAISE TOP FLAP" );
+      servoDriver.writeServo1( 90 );
+      fsmState = STATE_MOVE_ITEM_OUT;
+      break;
+
+    case STATE_MOVE_ITEM_OUT:
+      Serial.println( "MOVE ITEM OUT" );
+      if ( usDistance < 6 ) {
+        moveItemStepper.step( 600 );
+        fsmState = STATE_MOVE_ITEM_OUT;
+      } else {
+        fsmState = STATE_WAIT_FOR_ITEM;
+      }
+      break;
+
+    default:
+      Serial.println( "INVALID STATE" );
+      break;
+
+  }
+}


Added auto random send Jeenode's code

Added auto random send Jeenode's 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/labfab/vitrines-io.git/'


Create explorer_robot.ino

Create explorer_robot.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/firatozz/Explorer-Robot.git/'


remove fade between colors

remove fade between colors

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


Create a separate ground unit to control line tension

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

--- Arduino/TensionGroundUnit/GroundUnit.ino
+++ Arduino/TensionGroundUnit/GroundUnit.ino
@@ -0,0 +1,400 @@
+// Copyright (c) 2013 Nautilabs
+// https://github.com/baptistelabat/robokite
+
+// This file used SoftwareSerial example (Copyright (c) 2012 Dimension Engineering LLC)
+// for Sabertooth http://www.dimensionengineering.com/software/SabertoothSimplifiedArduinoLibrary/html/index.html
+// See license.txt in the Sabertooth arduino library for license details.
+//
+// The Sabertooth selector 1 3 5 6 have to be on on.
+
+// Includes
+#include <SoftwareSerial.h>
+#include <SabertoothSimplified.h> // From http://www.dimensionengineering.com/software/SabertoothArduinoLibraries.zip
+#include <TinyGPS++.h>    // From https://github.com/mikalhart/TinyGPSPlus
+#include <PID_v1.h>       // From https://github.com/br3ttb/Arduino-PID-Library/tree/master/PID_v1
+#include <SPI.h> // Not actualy used but needed to compile
+#include <MavlinkForArduino.h>
+
+// Port definition
+#define      TX_PIN 8 // Plug to Sabertooth RX
+#define      RX_PIN 10 // Do not plug
+#define RF_DATA_PIN 11
+#define     LED_PIN 13 // Built-in led
+
+
+// String management
+String inputString = "";         // a string to hold incoming data
+boolean stringComplete = false;  // whether the string is complete
+
+// Sabertooth connection
+// Note: NOT_A_PIN (0) was previously used for RX which is not used, but this was causing problems
+SoftwareSerial SWSerial(RX_PIN, TX_PIN); // RX, TX. RX on no pin (unused), TX on pin 8 (to S1).
+SabertoothSimplified ST(SWSerial); // Use SWSerial as the serial port.
+int power1, power2;
+
+// NMEA protocol for robust messages
+TinyGPSPlus nmea;
+// O stands for Opensource, R for Robokite
+// The index is the place of the field in the NMEA message
+TinyGPSCustom feedback_request      (nmea, "ORFBR", 1);  // Feedback request. The feedback are normalized between 0 and 1023
+// The orders are normalized between -127 and 127
+TinyGPSCustom pwm1     (nmea, "ORPW1", 1);  // Dimentionless voltage setpoint (Pulse Width Modulation) for Sabertooth output 1
+TinyGPSCustom pwm2     (nmea, "ORPW2", 1);  // Dimentionless voltage setpoint (Pulse Width Modulation) for Sabertooth output 2
+TinyGPSCustom setpos1  (nmea, "ORSP1", 1);  // Position setpoint for Sabertooth output 1
+TinyGPSCustom setpos2  (nmea, "ORSP2", 1);  // Position setpoint for Sabertooth output 2
+TinyGPSCustom speedlim1  (nmea, "ORSL1", 1);  // Speed limitation for Sabertooth output 1
+TinyGPSCustom speedlim2  (nmea, "ORSL2", 1);  // Speed limitation for Sabertooth output 2
+TinyGPSCustom poslim1  (nmea, "ORPL1", 1);  // Position limitation for Sabertooth output 1
+TinyGPSCustom poslim2  (nmea, "ORPL2", 1);  // Position limitation for Sabertooth output 2
+TinyGPSCustom kpm1 (nmea, "ORKP1", 1); // Proportional coefficient multiplicator
+//TinyGPSCustom kim1 (nmea, "ORKI1", 1); // Integral coefficient multiplicator
+TinyGPSCustom kdm1 (nmea, "ORKD1", 1); // Derivative coefficient multiplicator
+//TinyGPSCustom kpm2 (nmea, "ORKP2", 1); // Proportional coefficient multiplicator
+//TinyGPSCustom kim2 (nmea, "ORKI2", 1); // Integral coefficient multiplicator
+//TinyGPSCustom kdm2 (nmea, "ORKD2", 1); // Derivative coefficient multiplicator
+boolean isFeedbackRequested = false;
+
+uint8_t data[4];  // 2 element array of unsigned 8-bit type, holding Joystick readings
+
+
+
+// PID for robust control
+// Define Variables we'll be connecting to
+double Setpoint1, Input1, Output1;
+double Setpoint2, Input2, Output2;
+double Input3, Input4, Input5, Input6;
+float posSat1 = 1;
+float posSat2 = 1;
+float speedSat1 = 1;
+float speedSat2 = 1;
+// Specify the links and initial tuning parameters (Kp, Ki, Kd)
+float Kp1 = 1;
+float Ki1 = 0.00;
+float Kd1 = 0.001;
+float Kp2 = 1;
+float Ki2 = 0.00;
+float Kd2 = 0.001;
+PID myPID1(&Input1, &Output1, &Setpoint1, Kp1, Ki1, Kd1, DIRECT);
+PID myPID2(&Input2, &Output2, &Setpoint2, Kp2, Ki2, Kd2, DIRECT);
+
+
+#define ORDER_RATE_ms 100
+long last_order_ms = 0;
+long last_simu_ms = 0;
+int dt_ms = 0;
+
+boolean SIL = false; // Use Software in the Loop simulation
+
+/* HX711 part */
+#include "HX711.h"
+
+#define HX711_DOUT  12 // or DAT
+#define HX711_CLK   11
+#define HX711_GND   13
+
+#define OFFSET -797000 // From raw value when no load
+#define SCALE  37.0  // From calibration
+HX711 scale;
+long raw_value;
+void setup()
+{
+  setupHX711();
+  pinMode(LED_PIN, OUTPUT);
+
+  // Initialize software serial communication with Sabertooth
+  SWSerial.begin(9600);
+
+  // Initialize serial communications with computer
+  Serial.begin(115200);
+
+  // Reserve bytes for the inputString:
+  inputString.reserve(200);
+
+  // Initialize input and setpoint
+  Input1 = 0;
+  Input2 = 0;
+  Input3 = 0;
+
+  Setpoint1 = 0;
+  Setpoint2 = 0;
+
+  // Turn the PID on
+  myPID1.SetMode(MANUAL);
+  myPID2.SetMode(MANUAL);
+  // Saturate the output to the maximum range (values are normalized between -1 and 1)
+  myPID1.SetOutputLimits(-1, 1);
+  myPID2.SetOutputLimits(-1, 1);
+
+  for (int i=0;i<4;i++)
+  {
+    data[i] = 127;
+  }
+
+  last_simu_ms = millis();
+}
+
+void setupHX711() {
+  // Ground connection
+  scale.begin(HX711_DOUT, HX711_CLK);
+  pinMode(HX711_GND, OUTPUT);
+  Serial.print("HX711_DOUT -> D");
+  Serial.println(HX711_DOUT);
+  Serial.print("HX711_CLK -> D");
+  Serial.println(HX711_CLK);
+  Serial.print("HX711_GND -> D");
+  Serial.println(HX711_GND);
+  Serial.println("HX711_VCC -> 3V3");
+
+   // No calibration, read the raw value
+  scale.set_offset(0);
+  scale.set_scale(1);
+}
+
+/*
+  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;
+    }
+  }
+}
+
+void loop()
+{
+   processSerialInput();
+   processInput();
+   if (false==SIL)
+   {
+     computeFeedback();
+   }
+   computeOrder();
+   sendOrder();
+   if (SIL)
+   {
+     simulate();
+   }
+   sendFeedback();
+   delay(10);
+}
+void processInput()
+{
+  data[0] = scale.get_units();
+  Input1 = (data[0]-OFFSET)/SCALE;
+
+
+  Input4 = analogRead(A0)/1023.;
+  Input5 = analogRead(A1)/1023.;
+  Input6 = analogRead(A2)/1023.;
+}
+
+void processSerialInput()
+{
+  // Print the string when a newline arrives:
+  if (stringComplete)
+  {
+    // Serial.println(inputString);
+    char ctab[inputString.length()+1];
+    inputString.toCharArray(ctab, sizeof(ctab));
+    char *gpsStream = ctab;
+
+    while (*gpsStream)
+    {
+      if (nmea.encode(*gpsStream++))
+      {
+        if (pwm1.isUpdated())
+        {
+          pwm1.value();
+          myPID1.SetMode(MANUAL);
+        }
+        if (pwm2.isUpdated())
+        {
+          pwm2.value();
+          myPID2.SetMode(MANUAL);
+        }
+        if (setpos1.isUpdated())
+        {
+          setpos1.value();
+          myPID1.SetMode(AUTOMATIC);
+        }
+        if (setpos2.isUpdated())
+        {
+          setpos2.value();
+          myPID2.SetMode(AUTOMATIC);
+        }
+        if (feedback_request.isUpdated())
+        {
+          feedback_request.value();
+          // $ORFBR,0*57
+          isFeedbackRequested = true;
+          digitalWrite(LED_PIN, HIGH);
+        }
+        if (kpm1.isUpdated()||kdm1.isUpdated())//||kpm2.isUpdated()||kim2.isUpdated()||kdm2.isUpdated())
+        {
+          kpm1.value();
+          kdm1.value();
+          computePIDTuning();
+        }
+        if (speedlim1.isUpdated()||speedlim2.isUpdated()||poslim1.isUpdated()||poslim2.isUpdated())
+        {
+          updateSaturation();
+          speedlim1.value();
+          speedlim2.value();
+          poslim1.value();
+          poslim2.value();
+        }
+      }
+    }
+    // Clear the string:
+    inputString = "";
+    stringComplete = false;
+  }
+}
+
+void computeFeedback()
+{
+
+  // Feedbacks are normalized between -1 and 1
+
+  // Potentiometer angle
+  float rawAngle_deg = (data[0]-127)/255.0;
+
+}
+
+void sendFeedback()
+{
+  /*mavlink_message_t msg;
+  uint8_t bufout[MAVLINK_MAX_PACKET_LEN];
+  uint16_t len;
+  uint64_t time_us = micros();
+  int group_mlx = 0;
+  uint8_t system_id = 100;
+  uint8_t target_system = system_id;
+  uint8_t component_id = 1;
+  uint8_t target_component = 2;// Sabertooth
+  */
+  // All the feedback values are normalized in the range 0-1023 (10 bits resolution)
+  if (isFeedbackRequested)
+  {
+
+    float orders[8];
+    orders[0] = float(power1/127.);
+    orders[1] = float(power2/127.);
+    //mavlink_msg_set_actuator_control_target_pack(system_id, component_id, &msg, time_us, group_mlx, target_system, target_component, orders);
+    //len = mavlink_msg_to_send_buffer(bufout, &msg);
+    //Serial.write(bufout, len);
+
+    Serial.print((power1+127)*4);
+    Serial.print(", ");
+    Serial.print((power2+127)*4);
+    Serial.print(", ");
+    Serial.print((Input1+1)/2.*1023);
+    Serial.print(", ");
+    Serial.print((Input2+1)/2.*1023);
+    Serial.print(", ");
+    Serial.print((Input3+1)/2.*1023);
+    Serial.print(", ");
+    Serial.print((Input4+1)/2.*1023);
+    Serial.print(", ");
+    Serial.print((Input5+1)/2.*1023);
+    Serial.print(", ");
+    Serial.print((Input6+1)/2.*1023);
+    Serial.println("");
+    isFeedbackRequested = false;
+  }
+}
+
+void computeOrder()
+{
+  if (myPID1.GetMode() == MANUAL)
+  {
+    power1 = atoi(pwm1.value())*speedSat1;
+  }
+  if (myPID2.GetMode() == MANUAL)
+  {
+    power2 = atoi(pwm2.value())*speedSat2;
+  }
+  if (myPID1.GetMode() == AUTOMATIC)
+  {
+    Setpoint1 = atoi(setpos1.value())/127.*posSat1*1.3;//Factor to go a bit further and be sure to reach saturation (even with static error)
+    myPID1.Compute();
+    power1 = Output1*127;
+  }
+  if (myPID2.GetMode() == AUTOMATIC)
+  {
+    Setpoint2 = atoi(setpos2.value())/127.*posSat2*1.3;
+    myPID2.Compute();
+    power2 = Output2*127;
+  }
+  if (Input1>posSat1)
+  {
+    power1 = min(power1,0);
+  }
+  if (Input1<-posSat1)
+  {
+    power1 = max(power1,0);
+  }
+}
+
+void sendOrder()
+{
+  if (fabs(millis()-last_order_ms)>ORDER_RATE_ms)
+  {
+    last_order_ms = millis();
+  // Order in the range -127/127
+    //SWSerial.println(127);
+      //Saturation based on posSat
+   ST.motor(1, power1);
+   ST.motor(2, power2);
+  }
+}
+void computePIDTuning()
+{
+   myPID1.SetTunings(fabs(atof(kpm1.value())/127.*Kp1), 0, fabs(atof(kdm1.value())/127.*Kd1));
+
+ //myPID1.SetTunings(fabs(atof(kpm1.value())/127.*Kp1), fabs(atof(kim1.value())/127.*Ki1), fabs(atof(kdm1.value())/127.*Kd1));
+ //myPID2.SetTunings(fabs(atof(kpm2.value())/127.*Kp2), fabs(atof(kim2.value())/127.*Ki2), fabs(atof(kdm2.value())/127.*Kd2));
+ myPID1.SetControllerDirection(sgn(atoi(kpm1.value())));
+ //myPID2.SetControllerDirection(sgn(atoi(kpm2.value())));
+ //Serial.println(atof(kpm1.value())/127.*Kp1);
+}
+void updateSaturation()
+{
+  if (speedlim1.isUpdated())
+  {
+     myPID1.SetOutputLimits(-atoi(speedlim1.value())/127., atoi(speedlim1.value())/127.);
+     speedSat1 = atoi(speedlim1.value())/127.;
+  }
+  if (speedlim2.isUpdated())
+  {
+    myPID2.SetOutputLimits(-atoi(speedlim2.value())/127., atoi(speedlim2.value())/127.);
+  }
+  if (poslim1.isUpdated())
+  {
+    posSat1 = atoi(poslim1.value())/127.;
+  }
+  //posSat2 = atoi(poslim2.value())/127.;
+}
+static inline int8_t sgn(int val) {
+  if (val < 0) return -1;
+  if (val==0) return 0;
+  return 1;
+}
+
+void simulate()
+{ dt_ms = millis()-last_simu_ms;
+  Input1=Input1+power1/127.*dt_ms/1000.;
+  Input2=Input2+power2/127.*dt_ms/1000.;
+  last_simu_ms= millis();
+}


TCP server on ESP8266 v1.0

TCP server on ESP8266 v1.0

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


fiexed SensorThread example

fiexed SensorThread example

--- examples/SensorThread/SensorThread.ino
+++ examples/SensorThread/SensorThread.ino
@@ -41,6 +41,7 @@
 	void run(){
 		// Reads the analog pin, and saves it localy
 		value = map(analogRead(pin), 0,1023,0,255);
+		runned();
 	}
 };


defined keypress function

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


Update pt_remote controlled car.ino

Update pt_remote controlled car.ino

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