prog arduino

prog arduino

#include <math.h>
//bibliotecas para comunicação I2C com a Bússola HMC5883L
#include <Wire.h>
#include <HMC5883L.h>

int times = 0;

//controle de 2 DEBUGS dentro da programação
//o primeiro para o recebimento de dados e outro para a saída respectivamente
#define DEBUG0 0
#define DEBUG1 0

//pino do botão que liga ou desliga a thread t_pid
#define BUTTON 12

//máximo módulo recebido pelo vetor
#define MODULE_MAX 425

//'baudrate' da saída seria
#define SERIAL 9600

//número de repetições de leituras na bússola que serão feitas para se ter um valor de retorno
#define COMPASS_TIME 150

//define a potência mínima que o robô irá se mover
#define PERCENT_MIN 20

#define PID(a,b,c) a+b+c

//pinos dos motores - ponte H
int robot_out_0[2] = {3,4}, robot_out_1[2] = {5,6};

float angle_begin, error_angle, error_motor[2], error_velo, m_value; //float de conversão do angulo e dos errors do pid

float p_angle = 0, kp_angle = 1, i_angle = 0, ki_angle = 0;

double v_in[2] = {0,0}, v_robot[2] = {1,0}; //vetores de entrada e do robo

char x_axis[20] = {'0','\0'},  y_axis[20] = {'0','\0'};

boolean button;

HMC5883L compass; //Instância a biblioteca para a bússola

void vector_in()
{
//receber o vetor até o ponto
  char serial_in[20];
  char c = 0;
  byte index = 0;

//  double measure = millis();

  while(Serial.available() > 0 && c != '|')
  {
    if(index < 19)
    {
      c = Serial.read();
        x_axis[index] = c;
        index++;
        x_axis[index] = '\0';
      }
  }
  x_axis[index-1] = '\0';

  index = 0;
  while(Serial.available() > 0)
  {
    if(index < 19)
     {
       c = Serial.read();
       y_axis[index] = c;
       index++;
       y_axis[index] = '\0';
      }
   }

 //  measure = millis() - measure;

   Serial.println(times++);

  v_in[0] = atof(x_axis);
  v_in[1] = atof(y_axis);

 /*
  Serial.print(v_in[0]);
  Serial.print("|");
  Serial.println(v_in[1]);
 */

  m_value = sqrt(pow(v_in[0], 2) + pow(v_in[1], 2));

  if(m_value != 0)
  {
    v_in[0] /= m_value;
    v_in[1] /= m_value;
  }

   //receber o vetor do robô
   float angle;

   angle = angle_begin - get_angle();

   v_robot[0] = cos(angle);
   v_robot[1] = sin(angle);

   if(DEBUG0)
   {
    Serial.print(v_in[0]);
    Serial.print("|");
    Serial.print(v_in[1]);
    Serial.print("| Module: ");
    Serial.println(m_value);
    Serial.print(v_robot[0]);
    Serial.print("|");
    Serial.println(v_robot[1]);
   }
}

//função que recebe o ângulo da bússola
float get_angle()
{

  float heading; //Variável para armazenar o valor aferido
  float precisao; //Variável parar o melhorar a precisao do valor aferido

  precisao = 0; //Zera a variável para uma nova leitura

  for(int i=0;i<COMPASS_TIME;i++) //Faz a leitura 100 e armazenar a somatória
  {

    //Pega os dados necessários para o cálculo da bússola digital
    MagnetometerScaled scaled = compass.ReadScaledAxis();
    int MilliGauss_OnThe_XAxis = scaled.XAxis;
    heading = atan2(scaled.YAxis, scaled.XAxis);
    float declinationAngle = 0.3889; //Compensação dos polos (São Paulo - Recife)
    heading += declinationAngle;

    //Converte o valor aferido para angulo
    if(heading < 0)
    {
      heading += 2*PI;
    }

    if(heading > 2*PI)
    {
      heading -= 2*PI;
    }

    precisao = precisao + heading;
    delay(1);

  }

  heading = precisao/COMPASS_TIME; //Pega a somatória e tira a média dos valores aferidos
  return heading;
}

void pid()
{
  double produtoe[2], angle_b;
  float kp = 1;

  double moviment_sig;

  produtoe[0] = (v_in[0] * v_robot[0]) + (v_in[1] * v_robot[1]); //p.e. do angulo entre o vetor do robô e do vetor de posição recebido
  produtoe[1] = (v_in[0] * (v_robot[0] * -1)) + (v_in[1] * (v_robot[1] * -1));//p.e. entre o vetor oposto ao robô e do vetor de posição recebido
  if(acos(produtoe[0]) <= acos(produtoe[1]))
  {
    angle_b = acos(produtoe[0]);
    moviment_sig = 1;
  }
  else
  {
    angle_b = acos(produtoe[1]);
    moviment_sig = -1;
  }

  if(v_in[0] != 0 || v_in[1] != 0)
    error_angle = angle_b/PI;
  else
  {
    error_angle = 0;
    i_angle = 0;
  }

  if(v_robot[0] > v_in[0]) error_angle *= -1; //cálculo do erro para ser aplicado no motor, dependente do ângulo

  p_angle = error_angle * kp_angle;
  error_angle = PID(p_angle, i_angle, 0); //aplicação da proporcional
  error_angle = (error_angle - (-1)) * (100 - (-100)) / (1 - (-1)) + (-100);

  error_velo = m_value; //cálculo do erro para ser aplicado no motor, dependente do módulo e da direção em relação ao eixo y
  error_velo *= kp;
  error_velo = (error_velo - 0) * ((255 - fabs(error_angle)) - 0) / (MODULE_MAX - 0);

  error_motor[0] = (error_velo + error_angle) * moviment_sig; //saída nos motores proporcionais ao erro
  error_motor[1] = (error_velo - error_angle) * moviment_sig;

  if(error_motor[0] < ((PERCENT_MIN/100.0)*255.0) && error_motor[0] > ((-PERCENT_MIN/100.0)*255.0))
    error_motor[0] = 0;
  if(error_motor[1] < ((PERCENT_MIN/100.0)*255.0) && error_motor[1] > ((-PERCENT_MIN/100.0)*255.0))
    error_motor[1] = 0;

  if(DEBUG1)
  {
    Serial.print("|");
    Serial.print(error_motor[0]);
    Serial.print("| . |");             //debug serial sobre a movimentação dos motores
    Serial.print(error_motor[1]);
    Serial.println("|");
  }

  moviment();

}

// função que executa a movimentação do robô
void moviment()
{
  //motor esquerda
  if(error_motor[0] > 0)
  {
    analogWrite(robot_out_0[0], fabs(error_motor[0]));
    digitalWrite(robot_out_0[1], LOW);
  }
  else if(error_motor[0] > 255)
  {
    analogWrite(robot_out_0[0], 255);
    digitalWrite(robot_out_0[1], LOW);
  }
  else if(error_motor[0] < 0)
  {
    analogWrite(robot_out_0[1], fabs(error_motor[0]));
    digitalWrite(robot_out_0[0], LOW);
  }
  else if(error_motor[0] < -255)
  {
    analogWrite(robot_out_0[1], 255);
    digitalWrite(robot_out_0[0], LOW);
  }
  else
  {
    digitalWrite(robot_out_0[0], HIGH);
    digitalWrite(robot_out_0[1], HIGH);
  }

  //motor direita
  if(error_motor[0] > 0)
  {
    analogWrite(robot_out_1[0], fabs(error_motor[0]));
    digitalWrite(robot_out_1[1], LOW);
  }
  else if(error_motor[0] > 255)
  {
    analogWrite(robot_out_1[0], 255);
    digitalWrite(robot_out_1[1], LOW);
  }
  else if(error_motor[0] < 0)
  {
    analogWrite(robot_out_1[1], fabs(error_motor[0]));
    digitalWrite(robot_out_1[0], LOW);
  }
  else if(error_motor[0] < -255)
  {
    analogWrite(robot_out_1[1], 255);
    digitalWrite(robot_out_1[0], LOW);
  }
  else
  {
    digitalWrite(robot_out_1[0], HIGH);
    digitalWrite(robot_out_1[1], HIGH);
  }
}

void setup()
{

  for(int x = 0; x < 2; x++)
  {
    pinMode(robot_out_0[x], OUTPUT);
    pinMode(robot_out_1[x], OUTPUT);
  }

  pinMode(BUTTON, INPUT);

  Serial.begin(SERIAL);

  Wire.begin(); //Inicia a comunicação o I2C

//Configura a bússola
  compass = HMC5883L();
  compass.SetScale(1.3);
  compass.SetMeasurementMode(Measurement_Continuous);

  angle_begin = get_angle();//seta o cangulo inicial do robo
}

void loop()
{
  button = digitalRead(BUTTON);
  double time_in_millis = millis();

  vector_in();
  pid();
  time_in_millis = millis() - time_in_millis;
  if(DEBUG0)
  {
    Serial.print("time:");
    Serial.println(time_in_millis);
  }
}

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


FLAG_PRUEBAS_MOTOR

FLAG_PRUEBAS_MOTOR

Creo una constante para hacer pruebas y no tener que esperar 24 horas.
Si es true hará una epera de 10 seg. entre riegos. En caso contrario funcionará como se espera.

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


photon sensor/actuator REPL, round 1

photon sensor/actuator REPL, round 1

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


Added Yun Example (With Provisioing)

Added Yun Example (With Provisioing)

//*****************************************************************************
//
// YunProvision - A simple example showing how to use the Exosite library
//                on the Arduino Yún with provisioning.
//
// Copyright (c) 2013 Exosite LLC.  All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:

//  * Redistributions of source code must retain the above copyright notice,
//    this list of conditions and the following disclaimer.
//  * Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the following disclaimer in the
//    documentation and/or other materials provided with the distribution.
//  * Neither the name of Exosite LLC nor the names of its contributors may
//    be used to endorse or promote products derived from this software
//    without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
// DAMAGES, FOR ANY REASON WHATSOEVER.
//
//*****************************************************************************

#include <Bridge.h>
#include <YunClient.h>
#include <Process.h>
#include <Exosite.h>
#include <EEPROM.h>

/*==============================================================================
* Configuration Variables
*
* Change these variables to your own settings.
*=============================================================================*/
// Use these variables to customize what datasources are read and written to.
String readString = "command&uptime";
String writeString = "uptime=";
String returnString;

// Number of Errors before we try a reprovision.
const unsigned char reprovisionAfter = 3;

/*==============================================================================
* End of Configuration Variables
*=============================================================================*/
class YunClient client;
Exosite exosite(&client);

unsigned char errorCount = reprovisionAfter;  // Force Provision On First Loop
char macString[18];  // Used to store a formatted version of the MAC Address

/*==============================================================================
* setup
*
* Arduino setup function.
*=============================================================================*/
void setup(){
  Bridge.begin();
  Serial.begin(115200);
  Serial.println("Boot");

  getYunMAC(macString, 18);

  // Print Some Useful Info
  Serial.print(F("MAC Address: "));
  Serial.println(macString);
}

/*==============================================================================
* loop
*
* Arduino loop function.
*=============================================================================*/
void loop(){
  // Check if we should reprovision.
  if(errorCount >= reprovisionAfter){
    if(exosite.provision("exosite", "ard-generic", macString)){
      errorCount = 0;
    }
  }

  //Write to "uptime" and read from "uptime" and "command" datasources.
  if ( exosite.writeRead(writeString+String(millis()), readString, returnString)){
    Serial.println("OK");
    Serial.println(returnString);
    errorCount = 0;
  }else{
    Serial.println("Error");
    errorCount++;
  }

  delay(5000);
}

void getYunMAC(char* MACptr, byte bufSize) {
  Process p;		// Create a process and call it "p"
  p.runShellCommand("/sbin/ifconfig -a | /bin/grep HWaddr |/bin/grep wlan0 | /usr/bin/awk '{print $5}'");

  for(int i = 0; i < (bufSize-1) && p.available() > 0; i++) {
    MACptr[i] = p.read();
    MACptr[i+1] = 0;
  }
}

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


ok, we should not use the xtarget with gearing

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


Create esp8266_webinterface.ino

Create esp8266_webinterface.ino

/*
  WS2812FX Webinterface.

  Harm Aldick - 2016
  www.aldick.org

  FEATURES
    * Webinterface with mode, color, speed and brightness selectors

  LICENSE

  The MIT License (MIT)

  Copyright (c) 2016  Harm Aldick

  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.

  CHANGELOG
  2016-11-26 initial version

*/
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <WS2812FX.h>

#include "index.html.h"
#include "main.js.h"

#define WIFI_SSID "YOURSSID"
#define WIFI_PASSWORD "YOURPASSWORD"

//#define STATIC_IP                       // uncomment for static IP, set IP below
#ifdef STATIC_IP
  IPAddress ip(192,168,0,123);
  IPAddress gateway(192,168,0,1);
  IPAddress subnet(255,255,255,0);
#endif

// QUICKFIX...See https://github.com/esp8266/Arduino/issues/263
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))

#define LED_PIN 2                       // 0 = GPIO0, 2=GPIO2
#define LED_COUNT 24

#define WIFI_TIMEOUT 30000              // checks WiFi every ...ms. Reset after this time, if WiFi cannot reconnect.
#define HTTP_PORT 80

#define DEFAULT_COLOR 0xFF5900
#define DEFAULT_BRIGHTNESS 255
#define DEFAULT_SPEED 200
#define DEFAULT_MODE FX_MODE_STATIC

#define BRIGHTNESS_STEP 15              // in/decrease brightness by this amount per click
#define SPEED_STEP 10                   // in/decrease brightness by this amount per click

unsigned long last_wifi_check_time = 0;
String modes = "";

WS2812FX ws2812fx = WS2812FX(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
ESP8266WebServer server = ESP8266WebServer(HTTP_PORT);

void setup(){
  Serial.begin(115200);
  Serial.println();
  Serial.println();
  Serial.println("Starting...");

  modes.reserve(5000);
  modes_setup();

  Serial.println("WS2812FX setup");
  ws2812fx.init();
  ws2812fx.setMode(DEFAULT_MODE);
  ws2812fx.setColor(DEFAULT_COLOR);
  ws2812fx.setSpeed(DEFAULT_SPEED);
  ws2812fx.setBrightness(DEFAULT_BRIGHTNESS);
  ws2812fx.start();

  Serial.println("Wifi setup");
  wifi_setup();

  Serial.println("HTTP server setup");
  server.on("/", srv_handle_index_html);
  server.on("/main.js", srv_handle_main_js);
  server.on("/modes", srv_handle_modes);
  server.on("/set", srv_handle_set);
  server.onNotFound(srv_handle_not_found);
  server.begin();
  Serial.println("HTTP server started.");

  Serial.println("ready!");
}

void loop() {
  unsigned long now = millis();

  server.handleClient();
  ws2812fx.service();

  if(now - last_wifi_check_time > WIFI_TIMEOUT) {
    Serial.print("Checking WiFi... ");
    if(WiFi.status() != WL_CONNECTED) {
      Serial.println("WiFi connection lost. Reconnecting...");
      wifi_setup();
    } else {
      Serial.println("OK");
    }
    last_wifi_check_time = now;
  }
}

/*
 * Connect to WiFi. If no connection is made within WIFI_TIMEOUT, ESP gets resettet.
 */
void wifi_setup() {
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(WIFI_SSID);

  WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
  WiFi.mode(WIFI_STA);
  #ifdef STATIC_IP
    WiFi.config(ip, gateway, subnet);
  #endif

  unsigned long connect_start = millis();
  while(WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");

    if(millis() - connect_start > WIFI_TIMEOUT) {
      Serial.println();
      Serial.print("Tried ");
      Serial.print(WIFI_TIMEOUT);
      Serial.print("ms. Resetting ESP now.");
      ESP.reset();
    }
  }

  Serial.println("");
  Serial.println("WiFi connected");
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
  Serial.println();
}

/*
 * Build
 string for all modes.
 */
void modes_setup() {
  modes = "";
  for(uint8_t i=0; i < ws2812fx.getModeCount(); i++) {
    modes += "
";
    modes += ws2812fx.getModeName(i);
    modes += "
";
  }
}

/* #####################################################
#  Webserver Functions
##################################################### */

void srv_handle_not_found() {
  server.send(404, "text/plain", "File Not Found");
}

void srv_handle_index_html() {
  server.send_P(200,"text/html", index_html);
}

void srv_handle_main_js() {
  server.send_P(200,"application/javascript", main_js);
}

void srv_handle_modes() {
  server.send(200,"text/plain", modes);
}

void srv_handle_set() {
  for (uint8_t i=0; i < server.args(); i++){
    if(server.argName(i) == "c") {
      uint32_t tmp = (uint32_t) strtol(&server.arg(i)[0], NULL, 16);
      if(tmp >= 0x000000 && tmp <= 0xFFFFFF) {
        ws2812fx.setColor(tmp);
      }
    }

    if(server.argName(i) == "m") {
      uint8_t tmp = (uint8_t) strtol(&server.arg(i)[0], NULL, 10);
      ws2812fx.setMode(tmp % ws2812fx.getModeCount());
    }

    if(server.argName(i) == "b") {
      if(server.arg(i)[0] == '-') {
        ws2812fx.decreaseBrightness(BRIGHTNESS_STEP);
      } else {
        ws2812fx.increaseBrightness(BRIGHTNESS_STEP);
      }
    }

    if(server.argName(i) == "s") {
      if(server.arg(i)[0] == '-') {
        ws2812fx.decreaseSpeed(SPEED_STEP);
      } else {
        ws2812fx.increaseSpeed(SPEED_STEP);
      }
    }
  }
  server.send(200, "text/plain", "OK");
}
0

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


Sensor board v0.2 Arduino test code

Sensor board v0.2 Arduino test code

Read all data in serial monitor.
Untested: TSL2561
Untested: MAX4466

/*
  Sensor Board v0.2
  Measures Temperature, Relative Humidity, Light intensity,
  Air pressure (and derived altitude), Sound intensity,
  concentrations of CO, NO2, VOC (derived) and CO2 (derived)

  Currently untested: TSL2561 light sensor code
  Currently untested: MAX4466 mic + amp code

  Designed at CRT Labs (July 2016)
  https://github.com/NationalAssociationOfRealtors/SensorBoard

  Modified: 6 September 2016
  by Akram Ali
 */

// define libraries
#include <Arduino.h>
#include <Wire.h>
#include "Adafruit_SHT31.h"
#include "SparkFunMPL3115A2.h"
#include <Adafruit_Sensor.h>
#include <Adafruit_TSL2561_U.h>

// define objects
MPL3115A2 myPressure;
Adafruit_SHT31 sht31 = Adafruit_SHT31();
Adafruit_TSL2561_Unified tsl = Adafruit_TSL2561_Unified(TSL2561_ADDR_FLOAT, 12345);

// define IAQ core global variables
#define iaqaddress 0x5A
uint16_t predict;
uint8_t statu;
int32_t resistance;
uint16_t tvoc;

// define MICS-4514 global variables
#define PRE_PIN          8
#define VNOX_PIN         A0
#define VRED_PIN         A1
#define PRE_HEAT_SECONDS 10
int vnox_value = 0;
int vred_value = 0;

// define TSL2561 global variables
long lux;

void setup()
{
  Serial.begin(115200);
  Serial.println("Setup");

  pinMode(9, OUTPUT);  // pin 9 controls LED
  pinMode(5, OUTPUT);   // pin 5 controls power to all sensors
  digitalWrite(5, HIGH);  // turn all sensors on
  delay(10);

  pinMode(PRE_PIN, OUTPUT);  // set preheater pin for mics4514 gas sensor
  Serial.print("MICS-4514 Preheating...");
  // Wait for preheating
  digitalWrite(PRE_PIN, 1);
  delay(PRE_HEAT_SECONDS * 1000);
  digitalWrite(PRE_PIN, 0);
  Serial.println("Done");

}

// the loop function runs over and over again forever
void loop()
{
  digitalWrite(9, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(9, LOW);    // turn the LED off by making the voltage LOW

  Serial.println("---------------------");

  // MAX 4466 amp
  //Serial.println(analogRead(A0));  // read sound levels
  //Serial.println();

  // TSL2561 light sensor
  tsl.begin();
  tsl.enableAutoRange(true);
  //tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_13MS);      /* fast but low resolution */
  tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_101MS);  /* medium resolution and speed   */
  // tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_402MS);  /* 16-bit data but slowest conversions */
  sensors_event_t event;
  tsl.getEvent(&event);
  if (event.light)
    lux = event.light;
  else
    lux = -1;
  Serial.print("Light intensity (lux): ");
  Serial.println(lux);

  // MICS 4514 CO/NO2 gas sensor
  // Read analog values, print them out, and wait
  vnox_value = analogRead(VNOX_PIN);
  vred_value = analogRead(VRED_PIN);
  Serial.print("Vnox: ");
  Serial.print(vnox_value, DEC);
  Serial.print(" Vred: ");
  Serial.println(vred_value, DEC);
  readCO();
  readNO2();

  // MPL3115A2 air pressure sensor
  myPressure.begin(); // Get pressure sensor online
  //Configure the sensor
  //myPressure.setModeAltimeter(); // Measure altitude above sea level in meters
  myPressure.setModeBarometer(); // Measure pressure in Pascals from 20 to 110 kPa

  myPressure.setOversampleRate(7); // Set Oversample to the recommended 128
  myPressure.enableEventFlags(); // Enable all three pressure and temp event flags
  delay(10);

  float pressure = myPressure.readPressure();
  Serial.print("MPL3115A2 Pressure(Pa): ");
  Serial.println(pressure, 2);

  float temperature = myPressure.readTempF();
  Serial.print("MPL3115A2 Temp(f): ");
  Serial.println(temperature, 2);

  //const int station_elevation_ft = 5374; //Must be obtained with a GPS unit
  //float station_elevation_m = station_elevation_ft * 0.3048; //I'm going to hard code this
  const int station_elevation_m = 1638; //Accurate for the roof on my house
  //1 pascal = 0.01 millibars
  pressure /= 100; //pressure is now in millibars

  float part1 = pressure - 0.3; //Part 1 of formula

  const float part2 = 8.42288 / 100000.0;
  float part3 = pow((pressure - 0.3), 0.190284);
  float part4 = (float)station_elevation_m / part3;
  float part5 = (1.0 + (part2 * part4));
  float part6 = pow(part5, (1.0/0.190284));
  float altimeter_setting_pressure_mb = part1 * part6; //Output is now in adjusted millibars
  float baroin = altimeter_setting_pressure_mb * 0.02953;

  Serial.print("MPL3115A2 Altimeter setting InHg: ");
  Serial.println(baroin, 2);

  // SHT31 T/RH sensor
  sht31.begin(0x44);
  Serial.print("SHT31 Temperature: ");
  Serial.println(sht31.readTemperature());
  Serial.print("SHT31 Humidity: ");
  Serial.println(sht31.readHumidity());

  // IAQ core
  Wire.requestFrom(iaqaddress, 9);
  predict = (Wire.read()<< 8 | Wire.read());
  statu = Wire.read();
  resistance = (Wire.read()& 0x00)| (Wire.read()<<16)| (Wire.read()<<8| Wire.read());
  tvoc = (Wire.read()<<8 | Wire.read());
  checkStatus();

  Serial.print("CO2 concentration:");
  Serial.println(predict);
  //Serial.print("IAQ core Status: ");
  //Serial.println(statu, HEX);
  Serial.print("IAQ core Resistance: ");
  Serial.println(resistance);
  Serial.print("TVoC concentration: ");
  Serial.println(tvoc);

  Serial.println();

  //digitalWrite(5, LOW);  // turn sensors off
  delay(5000);
}

void checkStatus()
{
  if(statu == 0x10)
  {
    Serial.println("IAQ Core Warming up...");
  }
  else if(statu == 0x00)
  {
    Serial.println("IAQ Core Ready");
  }
  else if(statu == 0x01)
  {
    Serial.println("IAQ Core Busy");
  }
  else if(statu == 0x80)
  {
    Serial.println("IAQ Core Error");
  }
  else
  Serial.println("No Status, check IAQ Core");
}

float readCO()
{
  float adc = analogRead(VNOX_PIN);
  float Rs = 47000.0/(1023.0/adc);
  float R0 = 82000.0;
  float ratio = Rs/R0;
  float concentration = ((-181.4)*log(ratio))-97.469;
  Serial.print("CO concentration (ppb): ");
  //Serial.println(adc);
  //Serial.println(Rs);
  //Serial.println(R0);
  //Serial.println(ratio);
  Serial.println(concentration);
  return concentration;
}

float readNO2()
{
  float adc = analogRead(VRED_PIN);
  float Rs = 22000.0/(1023.0/adc);
  float R0 = 350.0;
  float ratio = Rs/R0;
  float concentration = (124.28*log(ratio))-270.37;
  Serial.print("NO2 concentration (ppb): ");
  //Serial.println(adc);
  //Serial.println(Rs);
  //Serial.println(R0);
  //Serial.println(ratio);
  Serial.println(concentration);
  return concentration;
}

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


init just once

init just once

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


Test unitaire driver moteur

Test unitaire driver moteur

const int PWM = 3;
const int IN1 = 4;
const int IN2 = 5;
void setup() {
  pinMode(PWM,OUTPUT);
  pinMode(IN1,OUTPUT);
  pinMode(IN2,OUTPUT);

}

void loop() {
  digitalWrite(IN1,LOW);
  digitalWrite(IN2,LOW);
  analogWrite(PWM,1);
  delay(5000);
  digitalWrite(IN1,HIGH);
  digitalWrite(IN2,LOW);
  analogWrite(PWM,100);
  delay(10000);
  digitalWrite(IN1,LOW);
  digitalWrite(IN2,LOW);
  analogWrite(PWM,1);
  delay(5000);
  digitalWrite(IN1,LOW);
  digitalWrite(IN2,HIGH);
  analogWrite(PWM,1);
  delay(10000);

}

error: pathspec 'Asservissement/TestDriver/TestDriver1.0/TestDriver1.0.ino' did not match any file(s) known to git


State machine working in combination with BT and Serial.

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


Removed unused code.

Removed unused code.


Added Request Messages

Added Request Messages

Added a sketch to request a list of PGNs every second.

//Reading data from CAN and displaying it on a serial port
//Include the realtime clock functions inspired by the TimeTeensy3.ino example
//Add capability to send request messages

//Include the CAN libraries for the Teensy microprocessor
#include <FlexCAN.h>
#include <TimeLib.h>

const uint16_t PGNRequestList[28] = {
  65261, // Cruise Control/Vehicle Speed Setup
  65214, // Electronic Engine Controller 4
  65259, // Component Identification
  65242, // Software Identification
  65244, // Idle Operation
  65260, // Vehicle Identification
  65255, // Vehicle Hours
  65253, // Engine Hours, Revolutions
  65257, // Fuel Consumption (Liquid)
  65256, // Vehicle Direction/Speed
  65254, // Time/Date
  65211, // Trip Fan Information
  65210, // Trip Distance Information
  65209, // Trip Fuel Information (Liquid)
  65207, // Engine Speed/Load Factor Information
  65206, // Trip Vehicle Speed/Cruise Distance Information
  65205, // Trip Shutdown Information
  65204, // Trip Time Information 1
  65200, // Trip Time Information 2
  65250, // Transmission Configuration
  65253, // Engine Hours, Revolutions
  65203, // Fuel Information (Liquid)
  65201, // ECU History
  65168, // Engine Torque History
  64981, // Electronic Engine Controller 5
  64978, // ECU Performance
  64965, // ECU Identification Information
  65165  // Vehicle Electrical Power #2
};

uint8_t pgnIndex = 0;

//Declare which pin is connected to the LED
//Use the Teensy Reference Card and the board schematics to determine the pin number
const int redLEDpin = 21;

//initiate the CAN library at 250kbps
FlexCAN CANbus(250000);

//Set up the CAN data structure
static CAN_message_t rxmsg;
static CAN_message_t txmsg;

//set up a counter for each received message
unsigned long int rxCount = 0;

//set up a timer to toggle the LEDs so the delay function isn't needed.
elapsedMillis LEDtoggleTimer;
elapsedMillis millisecondsPerSecond;
elapsedMillis requestTimer;

const int millisBetweenRequests = 1000;

//Keep track of the LED state
boolean ledState = true;

//set up a variable to keep track of the timestamp
time_t previousTime = 0;

void setup() {
  // put your setup code here, to run once:

  // set the Time library to use Teensy 3.0's RTC to keep time
  setSyncProvider(getTeensy3Time);

  //declare the LED Pin to be the output
  pinMode(redLEDpin,OUTPUT);
  digitalWrite(redLEDpin,ledState); //Turn on the LED

  //start the CAN access
  CANbus.begin();
  rxmsg.timeout = 0;
  txmsg.timeout = 0;
  txmsg.len = 3;
  txmsg.id = 0x18EA00F6;
  txmsg.ext = 1;

  //try to wait for the Serial bus to come up for 1 second
  delay(1000);
  Serial.println(F("Teensy 3.2 CAN Receive Test."));

  //Set System Time
  if (timeStatus()!= timeSet) {
    Serial.println(F("Unable to sync with the RTC"));
  }
  else {
    Serial.println(F("RTC has set the system time"));
  }

  //print a header
  Serial.print(F("     Count\t    micros\tYYYY-MM-DD HH:MM:SS.ms\t  CAN ID\tDLC"));
  for (uint8_t i = 1; i<9;i++){ //label the byte columns according to J1939
    char byteDigits[4]; //declare a byte display array
    sprintf(byteDigits,"\tB%i",i);
    Serial.print(byteDigits);
  }

  //before entering the loop, set the previous time
  previousTime = now();
  //synchronize the millisecondPerSecond timer
  while (now() - previousTime < 1){
    millisecondsPerSecond = 0;
  }
}

void loop() {
  // put your main code here, to run repeatedly:

  //check to see if the number of seconds has changed to reset the millisecond timer for each second
  if (now() - previousTime == 1){
    previousTime = now();
    millisecondsPerSecond = 0;
  }

  // Uncomment this to synchronize the RTC to your PC time.
  /*  if (Serial.available()) {
      time_t t = processSyncMessage();
      if (t != 0) {
        Teensy3Clock.set(t); // set the RTC
        setTime(t);
      }
    }
  */

  while(CANbus.read(rxmsg)){
    rxCount++;

    uint32_t ID = rxmsg.id;
    uint8_t len = rxmsg.len;

    char timeCountIDandDLCdigits[50];
    sprintf(timeCountIDandDLCdigits,"%10i\t%10i\t%04i-%02i-%02iT%02i:%02i:%02i.%03i\t%08X\t%1i",rxCount,micros(),year(),month(),day(),hour(),minute(),second(),int(millisecondsPerSecond),ID,len);
    Serial.print(timeCountIDandDLCdigits);

    for (uint8_t i = 0; i<len;i++){
      char byteDigits[4];
      sprintf(byteDigits,"\t%02X",rxmsg.buf[i]);
      Serial.print(byteDigits);
    }
    Serial.println();
  }

  if (LEDtoggleTimer >=100){
    LEDtoggleTimer = 0; //reset the timer
    ledState = !ledState; // Toggle values
    digitalWrite(redLEDpin,ledState);
  }

  if (requestTimer >= millisBetweenRequests) {
    requestTimer = 0;
    uint16_t pgnToRequest = PGNRequestList[pgnIndex];
    pgnIndex++;
    if (pgnIndex > sizeof(PGNRequestList) ) pgnIndex = 0;

    txmsg.ext = 1;
    txmsg.id = 0x18EA00F9;
    txmsg.buf[0] = (pgnToRequest & 0x0000FF);
    txmsg.buf[1] = (pgnToRequest & 0x00FF00) >> 8 ;
    txmsg.buf[2] = (pgnToRequest & 0xFF0000) >> 16;
    txmsg.len = 3;
    CANbus.write(txmsg);
  }

}

time_t getTeensy3Time(){
  return Teensy3Clock.get();
}

/*  code to process time sync messages from the serial port   */
unsigned long processSyncMessage() {
  unsigned long pctime = 0L;
  const unsigned long DEFAULT_TIME = 1357041600; // Jan 1 2013

  if(Serial.find("T")) {
     pctime = Serial.parseInt();
     return pctime;
     if( pctime < DEFAULT_TIME) { // check the value is a valid time (greater than Jan 1 2013)
       pctime = 0L; // return 0 to indicate that the time is not valid
     }
  }
  return pctime;
}

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


acceleration & velocity are integers for 5041


Working Game-of-Life (Conway)

Working Game-of-Life (Conway)

#include "FastSPI_LED2.h"

#define LOOP_TIME 20
#define UPDATE_TIME 1000

#define ROWS 10
#define COLS 10
#define NUM_LEDS (ROWS*COLS)

// Init/define led arrays
CRGB leds[NUM_LEDS];    //current colours
CRGB newleds[NUM_LEDS]; //new colours

// Return 0-based led index for 0-based x and y grid co-ordinate values
// The LED string snakes through the grid, so every row the positive x direction switches
uint8_t xy2i(uint8_t x, uint8_t y){
  if(y%2){
    // It's an uneven row: x should be reversed---or subtracted from this line's
    //last index, which is the next line's first minus 1
    return (COLS*(y+1) - 1) - x;
  } else {
    // Even row: simply do COLS*y + x
    return COLS*y + x;
  }
}

// currently-alive cells
boolean alive[ROWS][COLS];
// cells alive in next step
boolean next[ROWS][COLS];

uint8_t getNeighbour(int8_t y, int8_t x){
  if( y<0 || y>=ROWS || x<0 || x>=COLS) return 0;
  if(alive[y][x]) return 1;
  return 0;
}

void GoLstep(){
  //execute a GoL-step
  for(uint8_t y=0; y!=ROWS; ++y){
    for(uint8_t x=0; x!=COLS; ++x){
      // First reset the next array
      next[y][x] = false;
      // Then calculate number of neighbours (n)
      uint8_t n = 0;
      // loop through all neighbouring cells
      for(int8_t dy=-1; dy!=2; ++dy){
        for(int8_t dx=-1; dx!=2; ++dx){
          if( dx==0 && dy==0 ) continue; //do not count itself
          n += getNeighbour((int8_t)y+dy,(int8_t)x+dx);
        }
      }
      // Make a decision based on number of alive neighbours
      if(n==3){
        // keeps living or is born next round
        next[y][x] = true;
      } else if(alive[y][x] && n==2){
        //stays alive with 2 neighbours
        next[y][x] = true;
      }
      // All other cases: die or stay dead
    }
  }
  // Now copy next to current (alive)
  memcpy(alive,next,sizeof(next));

  // Finally, update the newleds array
  for(uint8_t y=0; y!=ROWS; ++y){
    for(uint8_t x=0; x!=COLS; ++x){
      if(alive[y][x]){
        newleds[xy2i(x,y)].setHSV(127, 255, 255);
      } else {
        newleds[xy2i(x,y)] = CRGB::Black;
      }
    }
  }
}

void sendColors(){
  // simple FO low-pass between newleds and leds
  for(uint8_t i_led=0; i_led!=NUM_LEDS; ++i_led)
    for(uint8_t i=0; i!=3; ++i)
      leds[i_led][i] = (uint8_t) (((uint16_t) leds[i_led][i]*19 + newleds[i_led][i])/20);

  LEDS.show();
}

void setup(){
  LEDS.addLeds<WS2801, RGB>(leds, NUM_LEDS);
  // Limit the brightness somewhat (scale is 0-255)
  LEDS.setBrightness(127);

  // Initialise the leds to black (off)
  for(uint8_t i=0; i<NUM_LEDS; ++i){
    leds[i] = CRGB::Black;
  }
  LEDS.show();

  // seed initial cells
  randomSeed(analogRead(A0));
  for(uint8_t y=0; y!=ROWS; ++y){
    for(uint8_t x=0; x!=COLS; ++x){
      alive[y][x] = random(0,10)>5;
    }
  }
}

unsigned long lastLoopTime = 0;
unsigned long lastUpdateTime = 0;
void loop(){
  if(millis()-lastUpdateTime > UPDATE_TIME){
    GoLstep();
    lastUpdateTime = millis();
  }
  sendColors();

  while(millis()-lastLoopTime < LOOP_TIME){
    //wait
  }
  lastLoopTime = millis();
}

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


Separate object for the animation.

Separate object for the animation.

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


Initial LoRa test

Initial LoRa test

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


thinking of migrating to arduino

thinking of migrating to arduino

/* @param mode shoudl be one of:: INPUT, INPUT_PULLUP, and OUTPUT */
template <unsigned arduinoNumber,unsigned mode,unsigned polarity=digitalHigh> class Pin {
public:
  Pin(){
    pinMode(arduinoNumber,mode);
  }
  volatile operator bool()const{
    return digitalRead(arduinoNumber)==polarity;
  }
  bool operator =(bool value){
    digitalWrite(arduinoNumber,value?polarity:digitalHigh+digitalLow-polarity);
  }
}

/** pin 13 is attached to the high side of an LED */
Pin<13,0,digitalHigh> LED;//static constructors run just before main() is called, which in turn calls setup and loop.
Pin(12,1,digitalLow> button;

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:
  LED=!button;
}

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


Soil Sensor

Soil Sensor

/**
  Soil Sensor

    16 ----*
        |
        \
        /
        \ 10K
        /
        |
        |
   A0 ----*
        |
        |
        *--------> nail 1

        *--/\/\--> nail 2
        |   470Ω
        |
        |
   GND ----*

The 470Ω resistor on the second is protection against a short circuit.
If the nail, or its wire, were to touch the 3.3v power, the current will be
limited to 7mA (milliamps) as the NodeMCU can only handle a maximum of 12mA.

*/

// Include the Denbit library.
#include <Denbit.h>
// Initialize the denbit.
Denbit denbit;

// Constants won't change.
const int sensorPin = A0;       // the number of the sensor pin
const int powerPin  = 16;       // the number of the power pin
const int indicatorLed = 13;    // the green LED will indicate when a reading is being made
const long interval = 1000;     // how often to take a reading (milliseconds)

// Variables will change.
int sensorReading = 0;          // will store the reading from the senso

// Generally, you should use "unsigned long" for variables that hold time
// The value will quickly become too large for an int to store
unsigned long previousMillis = 0;   // will store last time the sensor was read

void setup() {
  // Start the serial output to monitor the sensor values.
  Serial.begin(115200);

  // Configure the power pin as an output
  pinMode(powerPin, OUTPUT);
  // Configure the led pin as an output
  pinMode(indicatorLed, OUTPUT);
}

void loop() {
  // Here is where you put code that needs to be running all the time.

  // Check to see if it's time to take a reading; that is, if the
  // difference between the current time and last time you took a reading
  // is bigger than the interval at which you want to take readings.
  unsigned long currentMillis = millis();

  if (currentMillis - previousMillis >= interval) {
    // Save this as the last time you took a reading.
    previousMillis = currentMillis;

    // Turn on the sensor power.
    // Power to the sensor is turned off when not taking a reading
    // to minimize corrosion  due to electromigration.
    digitalWrite(powerPin, HIGH);

    // Turn on the indicator LED
    digitalWrite(indicatorLed, HIGH);

    // Read the voltage passing through the soil.
    sensorReading = analogRead(sensorPin);
    // Send the value to the serial monitor.
    Serial.println(sensorReading);

    // Turn off the sensor power
    digitalWrite(powerPin, LOW);

    // Turn off the indicator LED
    digitalWrite(indicatorLed, LOW);
  }
}

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


Small changes in VexEncoder.ino

Small changes in VexEncoder.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/joeLoughboro/Harold.git/'


Delete mqtt_esp8266_pir.ino

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


Created example

Created example

Created simple example

/*
	Simple List

	This program shows basic usage of QList

	Created 30th November 2016
	By SloCompTech

	https://github.com/SloCompTech/QList

*/
QList<String> myList;
void setup()
{
  Serial.begin(9600);
  myList.push_back("First");
  myList.push_back("Second");
  myList.push_front("New first");
  Serial.println("Items:");
  for(int i=0;i<myList.size();i++)
  {
    Serial.println(myList.at(i));
  }
  myList.pop_back();
  Serial.println("Items:");
  for(int i=0;i<myList.size();i++)
  {
    Serial.println(myList.at(i));
  }
  myList.clear();
}
void loop()
{

}

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


Adding example 'HelloWorld'

Adding example 'HelloWorld'

#include <GingButton.h>

GingButton button(3);

void setup() {
  Serial.begin(9600);
  button.setCallback(&helloWorld, GING_BUTTON_LOW_HIGH);
}

void loop() {
  button.loop();
}

void helloWorld() {
  Serial.println("Hello World!");
}

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


Refactor.

Refactor.

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


Update PhaseDetector.ino

Update PhaseDetector.ino

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


INITIAL COMMIT

INITIAL COMMIT

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

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


Arduino-Ethernet-DHT11

#include <dht.h> //DHT11 LIBRARY
#include <UIPEthernet.h> //UIPE ETHERNT LIBRARY FOR THE ETHERNET MODULE ENC28J60
#define DHT11_PIN 9 // DHT11 IS CONNECTED TO PIN NUMBER 9 (ARDUINO UNO BOARD), OR SPECIFY ANY OTHER PIN
#define DEBUG // TURN DEBUGGING ON OR OFF, TO TURN IT OFF JUST COMMENT THIS LINE
dht DHT; // DEFINE A "dht" OBJECT INSTANCE WITH THE NAME "DHT"
/* ETHERNET SETTINGS
ARDUINO UNO PINS USED FOR THE ENC28J60 MODULE: 10=CS, 11=MOSI, 12=MISO, 13=SCK
THE ETHERNET MAC ADDRESS MUST BE UNIQUE IN THE PRIVATE LOCAL NETWORK
REMEMBER THAT THE MAC ADDRESS IS IN HEXADECIMAL FORMAT
IN THIS EXAMPLE WE USE THE FOLLOWING MAC ADDRESS : OE:96:03:38:94:92 */
byte mac[] = { 0x0E, 0x96, 0x03, 0x38, 0x94, 0x92 };
EthernetClient client; // CREATES A CLIENT WHICH CAN CONNECT TO A SPECIFIED INTERNET IP ADDRESS AND PORT
char server[] = "192.168.1.4"; /// IP ADDRESS OF THE LOCAL SERVER WE CONNECT AND SEND DATA TO
int  interval = 5000; // DELAY INTERVAL TO SAVE THE DATA IN THE DATABSE
long myinterval = 6000; //3 Minutes-> 180000ms INTERVAL BETWEEN DATA READINGS, I SET IT IN 6 SECONDS FOR TESTING PURPOSES
long previousMillis = 0;
int status = -2; // INITIALIZE THE CONNECTION STATUS VARIABLE
void setup() {
  Serial.begin(9600); // OPEN SERIAL COMMUNICATIONS AND WAIT FOR A PORT TO OPEN
  Ethernet.begin(mac); // INITIALIZES THE ETHERNET LIBRARY AND NETWORK SETTINGS
  /* ETHERNET SERIAL PRINTS
  INFORMATION ABOUT CLIENTS IP ADDRESS, THE SUBNET MASK OF THE NETWORK, THE GATEWAYS
  IP ADDRESS AND FINALLY THE DNS SERVER IP ADDRESS WHICH IS THE SAME AS THE GATEWAYS IP
  THESE INFORMATION WILL ONLY BE VISIBLE WHEN DEBUGGING IS ON */
#ifdef DEBUG
  Serial.println("Temperature Logger");
  Serial.println("*********************");
  Serial.print("IP Address   : ");
  Serial.println(Ethernet.localIP());
  Serial.print("Subnet Mask  : ");
  Serial.println(Ethernet.subnetMask());
  Serial.print("Default Gateway IP: ");
  Serial.println(Ethernet.gatewayIP());
  Serial.print("DNS Server IP     : ");
  Serial.println(Ethernet.dnsServerIP());
#endif
}

void loop() {
  unsigned long currentMillis = millis();
  // RESET ENC28J60 IN CASE OF FAILURE TO CONNECT WITH THE LOCAL SERVER
  if (!client.connect(server, 80)) {
#ifdef DEBUG
    Serial.println("Connection Failure: Resetting ENC28j60!");
#endif
    Enc28J60.init(mac); //RESET AND INITIALIZE THE ENC28J60 AND STARTS PACKET TRANSMISSION-RECEPTION
  } else {
    client.stop();
  }
  /* CONNECT TO THE SPECIFIED IP ADDRESS AND PORT
   IF A CONNECTION IS ESTABLISHED START SENDING DATA EVERY 3 MINUTES
   DATA WILL BE SENT AFTER THE FIRST 3 MINUTES
   ALSO WE CHECK THE STATUS OF THE SERVER
   THE FUNCTION CONNECT() RETURNS AN INT INDICATING CONNECTION STATUTS:
   SUCCESS (1)
   TIMED_OUT (-1)
   INVALID SERVER (-2)
   TRUNCATED (-3)
   INVALID RESPONSE (-4)*/
  status = client.connect(server, 80);
  if (status == 1) {
#ifdef DEBUG
    Serial.println("\nConnection Success");
#endif
    if (currentMillis - previousMillis > myinterval) {
      previousMillis = currentMillis;
      //READ DATA FROM THE DHT11 SENSOR
      int chk = DHT.read11(DHT11_PIN);
      /* THE READ11() FUNCTION RETURNS:
      DHTLIB_OK (0): THE SENSOR SAMPLE AND ITS CHECKSUM ARE OK
      DHTLIB_ERROR_CHECKSUM (-1): THE CHECKSUM TEST FAILED. THIS MEANS THE DATA WAS RECEIVED BUT MAY NOT BE CORRECT
      DHTLIB_ERROR_TIMEOUT (-2): A TIME OUT OCCURRED AND COMMUNICATION HAS FAILED
      BELOW WE CHECK THE STATUS OF THE SENSOR */
#ifdef DEBUG
      switch (chk) {
        case 0:
          Serial.print("Sensor OK");
          break;
        case -1:
          Serial.print("Checksum Test Failed");
          break;
        case -2:
          Serial.print("Time out Occurred, Communication Failed");
          break;
        default:
          Serial.print("Unknown Error");
          break;
      }
#endif
      // PRINT THE HUMIDITY AND TEMPERATURE VALUES IN THE SERIAL MONITOR
#ifdef DEBUG
      Serial.print("\nValues: ");
      Serial.print(DHT.humidity, 1);
      Serial.print(",\t");
      Serial.println(DHT.temperature, 1);
      Serial.println("Connected...sendingData");
#endif
      // MAKE A HTTP REQUEST
      // SPECIFY THE PHP FILE LOCATION IN THE SERVER
      //PRINT DATA TO THE SERVER THE CLIENT IS CONNECTED TO
      //STRUCTURE: "GET /filepath/yourfile.php?"
      client.print( "GET /arduEth/write_data.php?");
      client.print("hum="); //DATABASE VARIABLE IS USED
      client.print(DHT.humidity, 1); //THE VALUE TO WRITE IN THE DATABSE FOR HUMIDITY
      client.print("&&");
      client.print("temp=");
      client.print(DHT.temperature, 1); //THE VALUE TO WRITE IN THE DATABSE FOR TEMPERATURE
      client.println( " HTTP/1.1");
      client.print( "Host: " );
      client.println(server);
      client.println( "Connection: close" );
      client.println();
      client.println();
      client.stop(); // DISCONNECT FROM THE SERVER
      delay(interval); //SOME INTERVAL FOR THE DATA TO BE WRITTEN IN THE DATABASE
    }
  }
  // IN CASE OF A TIME_OUT
  else if (status == -1) {
#ifdef DEBUG
    Serial.println("Connection Timed Out !");
#endif
  }
  // IN CASE OF AN INVALID SERVER
  else if (status == -2) {
#ifdef DEBUG
    Serial.println("Invalid Server !");
#endif
  }
  // IN CASE OF TRUNCATION
  else if (status == -3) {
#ifdef DEBUG
    Serial.println("Truncated !");
#endif
  }
  // IN CASE OF AN INVALID RESPONSE
  else if (status == -4) {
#ifdef DEBUG
    Serial.println("Invalid Response !");
#endif
  }
  // IN CASE OF AN UNKNOWN ERROR
  else {
#ifdef DEBUG
    Serial.println("Unknown Error !");
#endif
  }
}

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


Update Homotica_ESP8266.ino

Update Homotica_ESP8266.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/homotica/homotica.git/'


Ready for office

Ready for office

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


ads1115 test

ads1115 test

// 5pin
/* 24l01p    pro mini
   1  gnd   -
   2  vcc   +
   3  ce    9
   4  csn   10
   5  sck   13
   6  mosi  11
   7  miso  12
*/

#include <avr/wdt.h>
#include <avr/interrupt.h>
#include <avr/sleep.h>
#include <avr/pgmspace.h>
#include <avr/power.h>
#include <SPI.h>
#include <LowPower.h>
#include "nRF24L01.h"
#include "RF24.h"
#include <Wire.h>
#include <Adafruit_ADS1015.h>

#define adc_disable() (ADCSRA &= ~(1<<ADEN)) // disable ADC
#define adc_enable()  (ADCSRA |=  (1<<ADEN)) // re-enable ADC

#define CE_PIN 9
#define CSN_PIN 10

#define DEVICE_ID 15
#define CHANNEL 100

const uint64_t pipes[2] = { 0xFFFFFFFFFFLL, 0xCCCCCCCCCCLL };

typedef struct {
  uint32_t _salt;
  uint16_t volt;
  int16_t data1;
  int16_t data2;
  uint8_t devid;
} data;

data payload;

RF24 radio(CE_PIN, CSN_PIN);
Adafruit_ADS1115 ads(0x48);  /* Use this for the 16-bit version */

void setup() {
  Serial.begin(115200);

  delay(20);
  unsigned long startmilis = millis();
  adc_disable();

  radio.begin();
  radio.setChannel(CHANNEL);
  radio.setPALevel(RF24_PA_LOW);
  radio.setDataRate(RF24_250KBPS);
  //radio.setAutoAck(1);
  radio.setRetries(15, 15);
  radio.setPayloadSize(11);
  radio.openWritingPipe(pipes[0]);
  radio.stopListening();
  radio.powerDown();

  unsigned long stopmilis = millis();
  payload.data2 = ( stopmilis - startmilis ) * 10 ;

  payload._salt = 0;
  payload.devid = DEVICE_ID;
}

void loop() {
  /*
  unsigned long startmilis = millis();

  payload._salt++;
  payload.data1 = 10 ;
  payload.volt = readVcc();

  radio.powerUp();
  radio.write(&payload , sizeof(payload));
  radio.powerDown();

  unsigned long stopmilis = millis();

  payload.data2 = ( stopmilis - startmilis ) * 10 ;
  */

  delay(5000);

}

int readVcc() {
  adc_enable();
  // Read 1.1V reference against AVcc
  // set the reference to Vcc and the measurement to the internal 1.1V reference
#if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  ADMUX = _BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
#elif defined (__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
  ADMUX = _BV(MUX5) | _BV(MUX0);
#elif defined (__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)
  ADMUX = _BV(MUX3) | _BV(MUX2);
#else
  ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
#endif

  delay(2); // Wait for Vref to settle
  ADCSRA |= _BV(ADSC); // Start conversion
  while (bit_is_set(ADCSRA, ADSC)); // measuring

  uint8_t low  = ADCL; // must read ADCL first - it then locks ADCH
  uint8_t high = ADCH; // unlocks both

  long result = (high << 8) | low;

  result = 1125300L / result; // Calculate Vcc (in mV); 1125300 = 1.1*1023*1000
  adc_disable();

  return (int)result; // Vcc in millivolts
}

error: pathspec '_41-promini-nrf24-ads1115/_41-promini-nrf24-ads1115.ino' did not match any file(s) known to git


Initial commit.

Initial commit.

#define TEMP_SENSOR_PIN D6

void setup() {
  Serial.println("Hello world!");

  Spark.publish("I'm alive", "It's true");
}

void loop() {
  Serial.println("Starting to read temperature.");

  readSensorData();

  Serial.println("Done reading temperature.");

  delay(10000);
}

void readSensorData() {
  pinMode(TEMP_SENSOR_PIN, OUTPUT);

  digitalWrite(TEMP_SENSOR_PIN, LOW);
  delay(5); // Wait between 1 and 10 ms

  digitalWrite(TEMP_SENSOR_PIN, HIGH);
  delayMicroseconds(30); // Pull high for 20-40 us

  pinMode(TEMP_SENSOR_PIN, INPUT);

  if (!waitFor(TEMP_SENSOR_PIN, LOW, 80)) {
    Serial.println("Sensor didn't pull line low!");
    return;
  }

  if (!waitFor(TEMP_SENSOR_PIN, HIGH, 80)) {
    Serial.println("Sensor didn't pull line high!");
    return;
  }

  unsigned long pulseWidths[40];
  unsigned char bits[40];

  for (int i = 39; i >= 0; i--) {
    // Wait for line to go low
    while (digitalRead(TEMP_SENSOR_PIN) != LOW) {}

    // Wait for line to go high
    while (digitalRead(TEMP_SENSOR_PIN) != HIGH) {}

    unsigned long startTime = micros();

    // Wait for line to go low
    while (digitalRead(TEMP_SENSOR_PIN) != LOW) {}

    pulseWidths[i] = micros() - startTime;
  }

  for (int i = 39; i >= 0; i--) {
    // Serial.print(i, DEC);
    // Serial.print(" ");
    // Serial.println(pulseWidths[i]);

    if (pulseWidths[i] > 30) {
      bits[i] = 1;
    } else {
      bits[i] = 0;
    }
  }

  uint16_t humidityRaw = read16(bits, 39);
  uint16_t temperatureRaw = read16(bits, 23);
  uint8_t checksum = read8(bits, 7);

  float humidity = convertToHumdity(humidityRaw);
  float temperature = convertToTemperature(temperatureRaw);

  Serial.print("Humidity: ");
  Serial.println(humidity);

  Serial.print("Temperature: ");
  Serial.println(temperature);

  verifyChecksum(humidityRaw, temperatureRaw, checksum);
}

bool waitFor(int pin, int value, unsigned int timeout) {
  unsigned long startTime = micros();

  while ((micros() - startTime) < timeout) {
    if (digitalRead(pin) == value) {
      return true;
    }
  }

  return false;
}

uint16_t read16(unsigned char *bits, int start) {
  uint16_t value = 0;

  for (int i = 0; i < 16; i++) {
    uint16_t bitContribution = bits[start - i] << (15 - i);
    value = value + bitContribution;
  }

  return value;
}

uint8_t read8(unsigned char *bits, int start) {
  uint8_t value = 0;

  for (int i = 0; i < 8; i++) {
    uint8_t bitContribution = bits[start - i] << (7 - i);
    value = value + bitContribution;
  }

  return value;
}

float convertToTemperature(uint16_t value) {
  bool isNegative = false;

  if ((value & 0x8000) == 0x8000) {
    isNegative = true;
  }

  value = value & 0x7FFF; // Mask out sign bit

  float temperature = value / 10.0f;

  if (isNegative) {
    temperature = -temperature;
  }

  return temperature;
}

float convertToHumdity(uint16_t value) {
  return value / 10.0f;
}

void verifyChecksum(uint16_t humidityRaw, uint16_t temperatureRaw, uint8_t receivedChecksum) {
  uint8_t part1 = ((humidityRaw & 0xFF00) >> 8);
  uint8_t part2 = humidityRaw & 0x00FF;
  uint8_t part3 = ((temperatureRaw & 0xFF00) >> 8);
  uint8_t part4 = temperatureRaw & 0x00FF;

  uint8_t calculatedChecksum = (part1 + part2 + part3 + part4) & 0xFF;

  if (calculatedChecksum == receivedChecksum) {
    Serial.println("Checksum OK");
  } else {
    Serial.println("Checksum not OK!");
  }
}

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


Create mirrored_Fire2012_on_one_strip.ino

//***************************************************************
// Example of running FastLED's Fire2012 example on the first
// half of a strip, and mirroring that to the the second half.
//
// The first thing I did was find & replace NUM_LEDS with NUM_LEDS/2
// in all parts of the Fire2012 function.
//
// Then I added the "mirror2ndHalf" function that always gets run
// right before FastLED.show()
//
// Marc Miller, Feb 2017
//***************************************************************

#include "FastLED.h"
#define DATA_PIN    11
#define CLK_PIN     13
#define LED_TYPE    LPD8806
#define COLOR_ORDER GRB
#define NUM_LEDS    32  // Total number of pixels in strip
#define BRIGHTNESS  100
CRGB leds[NUM_LEDS];

#define FRAMES_PER_SECOND 100

bool gReverseDirection = false;

//---------------------------------------------------------------
void setup() {
  Serial.begin(115200);  // Allows serial monitor output (check baud rate)
  delay(3000); // 3 second delay for recovery
  //FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
  FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
  FastLED.setBrightness(BRIGHTNESS);
  FastLED.clear();
  Serial.println("Setup done. \n");
}

//---------------------------------------------------------------
void loop()
{
  // Add entropy to random number generator; we use a lot of it.
  // random16_add_entropy( random());

  Fire2012(); // run simulation frame

  mirror2ndHalf();  // copy and mirror first half of strip to second half
  FastLED.show(); // display this frame
  FastLED.delay(1000 / FRAMES_PER_SECOND);
}

//---------------------------------------------------------------
// Fire2012 by Mark Kriegsman, July 2012
// as part of "Five Elements" shown here: http://youtu.be/knWiGsmgycY
////
// This basic one-dimensional 'fire' simulation works roughly as follows:
// There's a underlying array of 'heat' cells, that model the temperature
// at each point along the line.  Every cycle through the simulation,
// four steps are performed:
//  1) All cells cool down a little bit, losing heat to the air
//  2) The heat from each cell drifts 'up' and diffuses a little
//  3) Sometimes randomly new 'sparks' of heat are added at the bottom
//  4) The heat from each cell is rendered as a color into the leds array
//     The heat-to-color mapping uses a black-body radiation approximation.
//
// Temperature is in arbitrary units from 0 (cold black) to 255 (white hot).
//
// This simulation scales it self a bit depending on NUM_LEDS; it should look
// "OK" on anywhere from 20 to 100 LEDs without too much tweaking.
//
// I recommend running this simulation at anywhere from 30-100 frames per second,
// meaning an interframe delay of about 10-35 milliseconds.
//
// Looks best on a high-density LED setup (60+ pixels/meter).
//
//
// There are two main parameters you can play with to control the look and
// feel of your fire: COOLING (used in step 1 above), and SPARKING (used
// in step 3 above).
//
// COOLING: How much does the air cool as it rises?
// Less cooling = taller flames.  More cooling = shorter flames.
// Default 50, suggested range 20-100
#define COOLING  90

// SPARKING: What chance (out of 255) is there that a new spark will be lit?
// Higher chance = more roaring fire.  Lower chance = more flickery fire.
// Default 120, suggested range 50-200.
#define SPARKING 50

//---------------------------------------------------------------
// ***** NOTE: NUM_LEDS was replaced with NUM_LEDS/2 anywhere it was found
//       below.  This makes the fire only run on the first half of the strip. *****
//---------------------------------------------------------------
void Fire2012()
{
// Array of temperature readings at each simulation cell
  static byte heat[NUM_LEDS/2];

  // Step 1.  Cool down every cell a little
    for( int i = 0; i < NUM_LEDS/2; i++) {
      heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / NUM_LEDS/2) + 2));
    }

    // Step 2.  Heat from each cell drifts 'up' and diffuses a little
    for( int k= NUM_LEDS/2 - 1; k >= 2; k--) {
      heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;
    }

    // Step 3.  Randomly ignite new 'sparks' of heat near the bottom
    if( random8() < SPARKING ) {
      int y = random8(7);
      heat[y] = qadd8( heat[y], random8(160,255) );
    }

    // Step 4.  Map from heat cells to LED colors
    for( int j = 0; j < NUM_LEDS/2; j++) {
      CRGB color = HeatColor( heat[j]);
      int pixelnumber;
      if( gReverseDirection ) {
        pixelnumber = (NUM_LEDS/2-1) - j;
      } else {
        pixelnumber = j;
      }
      leds[pixelnumber] = color;
    }
}

//---------------------------------------------------------------
void mirror2ndHalf() {
  // copy in reverse order first half of strip to second half
  for (uint8_t i = 0; i < NUM_LEDS/2; i++) {
    leds[NUM_LEDS-1-i] = leds[i];
  }
}

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


Create sous-vide.ino

Create sous-vide.ino

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


EL Shield Arduino code added

EL Shield Arduino code added

#include <SoftwareSerial.h>

int inByte = 0;
int lastByte = 0;

SoftwareSerial mySerial(10, 11); // RX, TX

void setup() {
 for(int i = 4; i<8; i++)
 {
  pinMode(i, OUTPUT);
 }
  Serial.begin(9600);

  mySerial.begin(9600);
}

void setEL(int ch) // set a certain EL on
{
 for(int i = 4; i<8; i++) // all off
 {
  digitalWrite(i, LOW);
 }
 digitalWrite(ch+4, HIGH); // ch on
}

int count = 0;

void loop()
{
  if (mySerial.available())
  {
    int input = mySerial.read();
    //This exists for debugging purposes
    Serial.write(input);
    //This is dirty, but it works.
    int incomingByte = input - '0';
    int moduls = incomingByte%4;
    if(incomingByte != lastByte)
    {
      setEL(moduls);
    }
  }
  if (Serial.available())
  {
    mySerial.write(Serial.read());
  }
}

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


Combined serial to one push for whole page

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


Altitude Calibration at Altitude

Altitude Calibration at Altitude

Changed the altitude calibration scheme to be able to work high at high
altitudes on ascent to better cope with a reset during flight.

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


Heart and Brain SpikerBox code for Leonardo added

error: pathspec 'Heart-And-Brain/Arduino' did not match any file(s) known to git
error: pathspec 'Code/HeartAndBrainLeonardo/HEBSpikerboxLeonardo.ino' did not match any file(s) known to git


Added arduino file

Added arduino file

int PlayerOneLeft = 7; // Green player
int PlayerOneRight = 6; // Green player
int PlayerTwoLeft = 8; // Yellow player
int PlayerTwoRight = 9; // yellow player
int OneLeftBtnVal = 0;
int OneRightBtnVal = 0;
int TwoLeftBtnVal = 0;
int TwoRightBtnVal = 0;

void setup() {
  Serial.begin(9600);
  pinMode(PlayerOneLeft, OUTPUT);
  pinMode(PlayerOneRight, OUTPUT);
  pinMode(PlayerTwoLeft, OUTPUT);
  pinMode(PlayerTwoRight, OUTPUT);
}

void loop() {
  OneLeftBtnVal = digitalRead(PlayerOneLeft);
  OneRightBtnVal = digitalRead(PlayerOneRight);
  TwoLeftBtnVal = digitalRead(PlayerTwoLeft);
  TwoRightBtnVal = digitalRead(PlayerTwoRight);
  //String s = buttonValue1 + buttonValue2;
  Serial.print("AL");
  Serial.print(OneLeftBtnVal);
  Serial.print(":");
  Serial.print("AR");
  Serial.print(OneRightBtnVal);
  Serial.print(":");
  Serial.print("BL");
  Serial.print(TwoLeftBtnVal);
  Serial.print(":");
  Serial.print("BR");
  Serial.println(TwoRightBtnVal);

  delay(50);
}

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


Pince: en-têtes de fonctions partiellement complétées

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


Added a simple Extend-o-Hand motion capture sketch

/*
 * Extend-o-Hand simple motion capture sketch, copyright 2014 by Joshua Shinavier
 *
 * See: https://github.com/joshsh/extendo
 */

#define THREEAXIS             0
#define NINEAXIS              1

#include <ExtendoHand.h>

// ExtendoHand dependencies (they are included in ExtendoHand.cpp, but technically they must be included here)
#include <Droidspeak.h>
#include <ExtendOSC.h>
#include <Morse.h>
#include <RGBLED.h>
#include <Adafruit_NeoPixel.h>
#include <OSCMessage.h>
#include <OSCBundle.h>
#include <MMA7361.h>
#include <Wire.h>
#include <I2Cdev.h>
#include <ADXL345.h>
#include <ITG3200.h>
#include <HMC5883L.h>

ExtendoHand exoHand;

////////////////////////////////////////////////////////////////////////////////

void setup() {
    // output only
    exoHand.enableInput(false);

    exoHand.setup();
}

////////////////////////////////////////////////////////////////////////////////

void loop() {
    unsigned long now = exoHand.beginLoop();

    double ax, ay, az, gx, gy, gz, mx, my, mz;

    exoHand.getAcceleration(&ax, &ay, &az);
    exoHand.getRotation(&gx, &gy, &gz);
    exoHand.getHeading(&mx, &my, &mz);

    OSCMessage m("/exo/hand/motion");
    m.add((uint64_t) now);
    //m.add(exoHand.getLoopTime());
    m.add(ax); m.add(ay); m.add(az);
    m.add(gx); m.add(gy); m.add(gz);
    m.add(mx); m.add(my); m.add(mz);
    exoHand.getOSC()->sendOSC(m);
}

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


add obstacle detection into a func; increase readability

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


Deleted pyp_gait

Deleted pyp_gait

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


add basic LED blink/pwm

add basic LED blink/pwm

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/cwilkens/helioscope-lamp.git/'


Add SparkFun remote test

Add SparkFun remote test

/* sparkfun_remote_test.ino

Prints out decoded button when a message is received from the SparkFun IR remote.
*/

//Tell linker which libraries to include:
#include <arduino_tools_linkLib.h>
#include <arduino_timers_linkLib.h>
#include <ir_messaging_linkLib.h>

//Normal includes:
#include <irhw.h>
#include <ir_receiver.h>

//Device ID code:
const uint32_t CODE_DEVID = 0x10EF0000; //An NEC device remote

//Individual button codes:
const uint32_t CODE_POWER  = CODE_DEVID | 0xD827;
const uint32_t CODE_A      = CODE_DEVID | 0xF807;
const uint32_t CODE_B      = CODE_DEVID | 0x7887;
const uint32_t CODE_C      = CODE_DEVID | 0x58A7;
const uint32_t CODE_UP     = CODE_DEVID | 0xA05F;
const uint32_t CODE_DOWN   = CODE_DEVID | 0x00FF;
const uint32_t CODE_LEFT   = CODE_DEVID | 0x10EF;
const uint32_t CODE_RIGHT  = CODE_DEVID | 0x807F;
const uint32_t CODE_SELECT = CODE_DEVID | 0x20DF;
//NOTE: "|" concatenates upper 4 "device" hex codes with lower 4 "button" hex codes

//-----Instantiate HW-specific components-----
#define _HW_SELECTCONFIG 1 //1..2
const int PIN_IRRX = 4;               //IR receiver pin
const bool INVERT_IRRX_SIGNAL = true; //Depends on polarity of rx module

#if (_HW_SELECTCONFIG == 1)
   #define TIMER_IRRX 1                 //!*
   IRRX_CREATE_TMR16B(irRx, TIMER_IRRX, PIN_IRRX, INVERT_IRRX_SIGNAL)
#elif (_HW_SELECTCONFIG == 2)
   // ***ATmega1280/2560 only***
   #define TIMER_IRRX 4                 //!*
   IRRX_CREATE_TMR16B(irRx, TIMER_IRRX, PIN_IRRX, INVERT_IRRX_SIGNAL)
#endif
//!*Must be #define-d to work with pre-processor macro

void setup() {
   irRx.Configure();
   Serial.begin(9600);
   Serial.print("\n\n**********************");
   Serial.print("\nRX input pin: "); Serial.print(PIN_IRRX);
   Serial.print("\n");
}

void loop() {
   IRCtrl::IRMsg msg;

   if (irRx.PopMsg(&msg)) {
      if (IRCtrl::IRProtocol::NEC_RPT == msg.protocol) {
         //Repeat signal detected.
         //NOTE: NEC repeat signal has its own protocol... just easier that way.
         Serial.print(" REPEAT");
      } else {
         //Identify decoded signal (if supported):
         switch (msg.data) {
         case CODE_POWER:
            Serial.print("\nPOWER"); break;
         case CODE_A:
            Serial.print("\nA"); break;
         case CODE_B:
            Serial.print("\nB"); break;
         case CODE_C:
            Serial.print("\nC"); break;
         case CODE_UP:
            Serial.print("\nUP"); break;
         case CODE_DOWN:
            Serial.print("\nDOWN"); break;
         case CODE_LEFT:
            Serial.print("\nLEFT"); break;
         case CODE_RIGHT:
            Serial.print("\nRIGHT"); break;
         case CODE_SELECT:
            Serial.print("\nSELECT"); break;
         }
      }
   }
}

//Last line

error: pathspec 'libraries/ir_messaging/samples/sparkfun_remote_test/sparkfun_remote_test.ino' did not match any file(s) known to git


Not updating brightness bug fixed

Not updating brightness bug fixed

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


Add example for lora32 board.

Add example for lora32 board.

/*
  06/01/2016
  Author: Makerbro
  Platforms: ESP8266
  Language: C++
  File: DrawLogo.ino
  ------------------------------------------------------------------------
  Description:
  Drawing an image in the OLED display. The image date was generated using a
  bitmap generator.
  ------------------------------------------------------------------------
  Please consider buying products from ACROBOTIC to help fund future
  Open-Source projects like this! We'll always put our best effort in every
  project, and release all our design files and code for you to use.
  https://acrobotic.com/
  ------------------------------------------------------------------------
  License:
  Released under the MIT license. Please check LICENSE.txt for more
  information.  All text above must be included in any redistribution.
*/
#include <Wire.h>
#include <ACROBOTIC_SSD1306.h>

static unsigned char ACROBOT[] PROGMEM ={
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x80,0x80,0x00,0x00,0x00,0x02,
0x06,0x8E,0xFE,0xFC,0xFC,0xF8,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xE0,0xF8,0xF8,0xFC,0xFC,0xCE,0x86,0x02,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x03,0x0F,0x1F,0x1E,0x3C,0x3E,
0x3F,0x3F,0x3F,0x3F,0x7F,0xFF,0xFF,0xFE,0xFC,0x78,0x30,0x90,0xC0,0xE0,0xE0,0xF0,
0xF0,0xF0,0xF8,0xF8,0xF8,0xF0,0xF0,0xF0,0xE0,0xE0,0xC0,0x80,0x30,0x78,0xFC,0xFE,
0xFF,0xFF,0xFF,0x7F,0x3F,0x3F,0x3F,0x3F,0x3C,0x1E,0x1F,0x0F,0x03,0x00,0x00,0xF0,
0x00,0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,0xF0,0x10,0x10,0x10,0x10,0x10,
0x00,0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x20,0x10,0x10,0x10,0x30,0x60,0xC0,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0xF9,0xFE,0xFF,0x7F,0x3F,0x3F,0x1F,0x3F,
0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0x3F,0x3F,0x1F,0x1F,0x3F,0x7F,0xFF,0xFE,0xF9,0x83,
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,
0x01,0x01,0x01,0x01,0x1F,0x00,0x00,0x00,0x00,0x00,0x1F,0x11,0x11,0x11,0x11,0x11,
0x00,0x00,0x00,0x00,0x1F,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x1F,0x10,0x10,
0x10,0x10,0x10,0x00,0x00,0x00,0x07,0x08,0x10,0x10,0x10,0x18,0x0C,0x07,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x83,0x3F,0xFF,0xFF,0xF8,0xF0,0xF8,0xFC,0xFC,
0xFE,0xFF,0x7F,0x9F,0x3F,0xFF,0xFE,0xFC,0xFC,0xF8,0xF0,0xF0,0xFF,0xFF,0x3F,0x87,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0xF0,
0x00,0xC0,0x7C,0x0C,0xF8,0x80,0x80,0xF8,0x0C,0x00,0x00,0x00,0xF0,0x18,0x0C,0x04,
0x04,0x04,0x08,0xF0,0x00,0x00,0x00,0x00,0xFC,0x44,0x44,0x44,0xC4,0x6C,0x38,0x00,
0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x04,0x04,0x04,
0x04,0x0C,0xF8,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0xC0,0xE0,0xF0,0x78,0x38,0x7C,
0xFC,0xFC,0xFC,0xFC,0xFE,0xFF,0xFF,0x7F,0x3E,0x1C,0x1B,0x07,0x3F,0x7F,0x7F,0x7F,
0x3F,0x3F,0x7F,0x7F,0x7F,0x3F,0x3F,0x7F,0x7F,0x7F,0x3F,0x07,0x0B,0x1C,0x3E,0x7F,
0xFF,0xFF,0xFE,0xFE,0xFC,0xFC,0xFC,0x7C,0x38,0x78,0xF0,0xE0,0xC0,0x00,0x00,0x00,
0x07,0x07,0x00,0x00,0x00,0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x06,0x04,
0x04,0x04,0x02,0x01,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x03,0x06,0x04,
0x00,0x00,0x00,0x07,0x04,0x04,0x04,0x04,0x04,0x00,0x00,0x00,0x07,0x04,0x04,0x04,
0x04,0x06,0x03,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x01,0x01,0x00,0x00,0x00,0x40,
0x60,0x71,0x7F,0x3F,0x3F,0x1F,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x07,0x1F,0x3F,0x3F,0x7F,0x73,0x60,0x40,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF
};

void setup()
{
  pinMode(16,OUTPUT);
  digitalWrite(16, LOW);    // set GPIO16 low to reset OLED
  delay(50);
  digitalWrite(16, HIGH); // while OLED is running, must set GPIO16 to high

  Wire.begin(4,15);
  oled.init();                      // Initialze SSD1306 OLED display
  oled.clearDisplay();              // Clear screen
  oled.drawBitmap(ACROBOT, 1024);   // 1024 pixels for logo
}

void loop()
{
}

error: pathspec 'microcontrollers/arduino-esp32/lora32-oled/lora32-oled.ino' did not match any file(s) known to git


upate demo

upate demo

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/Seeed-Studio/Grove_Serial_MP3_Player_V2.0.git/'


Delete main.ino

Delete main.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/irfansehic/web_based_rgb_controller.git/'


First test on Arduino Mega 2560

First test on Arduino Mega 2560

This is the first code I tried using a DHT11 Temperature and Humidity sensor on the main controller, the Arduino Mega 2560.
- mid January 2017

#include <Adafruit_Sensor.h>
#include <DHT.h>
#include <DHT_U.h>

#define DHTPIN            2         // Pin which is connected to the DHT sensor.

// Uncomment the type of sensor in use:
//#define DHTTYPE           DHT11     // DHT 11
#define DHTTYPE           DHT22     // DHT 22 (AM2302)
//#define DHTTYPE           DHT21     // DHT 21 (AM2301)

// See guide for details on sensor wiring and usage:
//   https://learn.adafruit.com/dht/overview

DHT_Unified dht(DHTPIN, DHTTYPE);

uint32_t delayMS;

void setup() {
  Serial.begin(9600);
  // Initialize device.
  dht.begin();
  Serial.println("DHTxx Unified Sensor Example");
  // Print temperature sensor details.
  sensor_t sensor;
  dht.temperature().getSensor(&sensor);
  Serial.println("------------------------------------");
  Serial.println("Temperature");
  Serial.print  ("Sensor:       "); Serial.println(sensor.name);
  Serial.print  ("Driver Ver:   "); Serial.println(sensor.version);
  Serial.print  ("Unique ID:    "); Serial.println(sensor.sensor_id);
  Serial.print  ("Max Value:    "); Serial.print(sensor.max_value); Serial.println(" *C");
  Serial.print  ("Min Value:    "); Serial.print(sensor.min_value); Serial.println(" *C");
  Serial.print  ("Resolution:   "); Serial.print(sensor.resolution); Serial.println(" *C");
  Serial.println("------------------------------------");
  // Print humidity sensor details.
  dht.humidity().getSensor(&sensor);
  Serial.println("------------------------------------");
  Serial.println("Humidity");
  Serial.print  ("Sensor:       "); Serial.println(sensor.name);
  Serial.print  ("Driver Ver:   "); Serial.println(sensor.version);
  Serial.print  ("Unique ID:    "); Serial.println(sensor.sensor_id);
  Serial.print  ("Max Value:    "); Serial.print(sensor.max_value); Serial.println("%");
  Serial.print  ("Min Value:    "); Serial.print(sensor.min_value); Serial.println("%");
  Serial.print  ("Resolution:   "); Serial.print(sensor.resolution); Serial.println("%");
  Serial.println("------------------------------------");
  // Set delay between sensor readings based on sensor details.
  delayMS = sensor.min_delay / 1000;
}

void loop() {
  // Delay between measurements.
  delay(delayMS);
  // Get temperature event and print its value.
  sensors_event_t event;
  dht.temperature().getEvent(&event);
  if (isnan(event.temperature)) {
    Serial.println("Error reading temperature!");
  }
  else {
    Serial.print("Temperature: ");
    Serial.print(event.temperature);
    Serial.println(" *C");
  }
  // Get humidity event and print its value.
  dht.humidity().getEvent(&event);
  if (isnan(event.relative_humidity)) {
    Serial.println("Error reading humidity!");
  }
  else {
    Serial.print("Humidity: ");
    Serial.print(event.relative_humidity);
    Serial.println("%");
  }
}

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


Restore life balance

Restore life balance

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/onordbo/mood-cloud.git/'


Adding test directory

Adding test directory

void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println(5);
}

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


first version, w/ oled display a/ rotary encoder no support for nfc yet

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);

#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2

#define LOGO16_GLCD_HEIGHT 16
#define LOGO16_GLCD_WIDTH  16
#include <Encoder.h>
Encoder myEnc(2, 3);
#if (SSD1306_LCDHEIGHT != 64)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif

void setup()   {
  Serial.begin(9600);

long oldPosition  = -999;

  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.clearDisplay();

  // draw the first ~12 characters in the font
  //testdrawchar();
  //display.display();
  //delay(2000);
  //display.clearDisplay();

  // draw scrolling text
  //testscrolltext();
  //delay(2000);
  //display.clearDisplay();

  // text display tests
 // display.setTextSize(1);
 // display.setTextColor(WHITE);

}

long oldPosition  = -999;

void loop() {
 long newPosition = myEnc.read();
  if (newPosition != oldPosition)
  {
    oldPosition = newPosition -1;
    Serial.println(oldPosition);

      display.clearDisplay();
      display.setCursor(0,0);
  //display.println("Hello, world!");
  //display.setTextColor(BLACK, WHITE); // 'inverted' text
  //display.println(3.141592);
  display.setTextSize(4);
  display.setTextColor(WHITE);
  display.print(oldPosition);
  display.display();
  }
}

void testdrawchar(void) {
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,0);

  for (uint8_t i=0; i < 168; i++) {
    if (i == '\n') continue;
    display.write(i);
    if ((i > 0) && (i % 21 == 0))
      display.println();
  }
  display.display();
}

void testdrawcircle(void) {
  for (int16_t i=0; i<display.height(); i+=2) {
    display.drawCircle(display.width()/2, display.height()/2, i, WHITE);
    display.display();
  }
}

void testfillrect(void) {
  uint8_t color = 1;
  for (int16_t i=0; i<display.height()/2; i+=3) {
    // alternate colors
    display.fillRect(i, i, display.width()-i*2, display.height()-i*2, color%2);
    display.display();
    color++;
  }
}

void testdrawtriangle(void) {
  for (int16_t i=0; i<min(display.width(),display.height())/2; i+=5) {
    display.drawTriangle(display.width()/2, display.height()/2-i,
                     display.width()/2-i, display.height()/2+i,
                     display.width()/2+i, display.height()/2+i, WHITE);
    display.display();
  }
}

void testfilltriangle(void) {
  uint8_t color = WHITE;
  for (int16_t i=min(display.width(),display.height())/2; i>0; i-=5) {
    display.fillTriangle(display.width()/2, display.height()/2-i,
                     display.width()/2-i, display.height()/2+i,
                     display.width()/2+i, display.height()/2+i, WHITE);
    if (color == WHITE) color = BLACK;
    else color = WHITE;
    display.display();
  }
}

void testdrawroundrect(void) {
  for (int16_t i=0; i<display.height()/2-2; i+=2) {
    display.drawRoundRect(i, i, display.width()-2*i, display.height()-2*i, display.height()/4, WHITE);
    display.display();
  }
}

void testfillroundrect(void) {
  uint8_t color = WHITE;
  for (int16_t i=0; i<display.height()/2-2; i+=2) {
    display.fillRoundRect(i, i, display.width()-2*i, display.height()-2*i, display.height()/4, color);
    if (color == WHITE) color = BLACK;
    else color = WHITE;
    display.display();
  }
}

void testdrawrect(void) {
  for (int16_t i=0; i<display.height()/2; i+=2) {
    display.drawRect(i, i, display.width()-2*i, display.height()-2*i, WHITE);
    display.display();
  }
}

void testdrawline() {
  for (int16_t i=0; i<display.width(); i+=4) {
    display.drawLine(0, 0, i, display.height()-1, WHITE);
    display.display();
  }
  for (int16_t i=0; i<display.height(); i+=4) {
    display.drawLine(0, 0, display.width()-1, i, WHITE);
    display.display();
  }
  delay(250);

  display.clearDisplay();
  for (int16_t i=0; i<display.width(); i+=4) {
    display.drawLine(0, display.height()-1, i, 0, WHITE);
    display.display();
  }
  for (int16_t i=display.height()-1; i>=0; i-=4) {
    display.drawLine(0, display.height()-1, display.width()-1, i, WHITE);
    display.display();
  }
  delay(250);

  display.clearDisplay();
  for (int16_t i=display.width()-1; i>=0; i-=4) {
    display.drawLine(display.width()-1, display.height()-1, i, 0, WHITE);
    display.display();
  }
  for (int16_t i=display.height()-1; i>=0; i-=4) {
    display.drawLine(display.width()-1, display.height()-1, 0, i, WHITE);
    display.display();
  }
  delay(250);

  display.clearDisplay();
  for (int16_t i=0; i<display.height(); i+=4) {
    display.drawLine(display.width()-1, 0, 0, i, WHITE);
    display.display();
  }
  for (int16_t i=0; i<display.width(); i+=4) {
    display.drawLine(display.width()-1, 0, i, display.height()-1, WHITE);
    display.display();
  }
  delay(250);
}

void testscrolltext(void) {
  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(10,0);
  display.clearDisplay();
  display.println("scroll");
  display.display();

  display.startscrollright(0x00, 0x0F);
  delay(2000);
  display.stopscroll();
  delay(1000);
  display.startscrollleft(0x00, 0x0F);
  delay(2000);
  display.stopscroll();
  delay(1000);
  display.startscrolldiagright(0x00, 0x07);
  delay(2000);
  display.startscrolldiagleft(0x00, 0x07);
  delay(2000);
  display.stopscroll();
}

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


Add test of the preceding commit

Add test of the preceding commit

/* Code to test that the output to the pi is working.
  Requires an analog temperature sensor that is included in an Arduino starter
  kit */

const int tempPin = A0;

const float baselineTemp = 20.0;

#include <serial.h>
Serial mySerial;
PrintWriter output;

void setup() {
  mySerial = new Serial( this, Serial.list()[0], 9600 );
  output = createWriter( "data.txt" );
}

void loop() {
  int temp = analogRead(tempPin);
  temp = (temp / 1024.0) * 5.0;
  temp = (temp - 0.5) * 100;
  Serial.println(temp);
}

void draw() {
    if (mySerial.available() > 0 ) {
         String value = mySerial.readString();
         if ( value != null ) {
              output.println( value );
         }
    }
}

void keyPressed() {
    output.flush();  // Writes the remaining data to the file
    output.close();  // Finishes the file
    exit();  // Stops the program
}


fixed comments

fixed comments

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/danwahl/intercom-arduino.git/'


Upload ensemble two firmeware

Upload ensemble two firmeware

/* PHOBOS - EnsembleTwo firmware v.0.2 (27.05.2017)
 *
 * using:
 * Arduino v1.8.0
 * MIDI_Library v.4.3.1 by fortyseveneffects
 *
 * plays:
 * A - 4 motors on steel tubes
 * B - 4 motors on steel rods
 * C - 4 solenoids on steel bars
 * D - 3 solenoids on two membranes and one metal gong
 */

#include <MIDI.h>
#define MIDICH 2

// STEEL TUBES' PINS
#define A1 10
#define A2 11
#define A3 12
#define A4 13
// STEEL RODS' PINS
#define B1 6
#define B2 7
#define B3 8
#define B4 9
// STEEL BARS' PINS
#define C1 2
#define C2 3
#define C3 4
#define C4 5
// DRUMS&GONG'S PINS
#define D1 44
#define D2 45
#define D3 46

// make note to pin array
byte note2pin[38];
byte vel, pitch;

MIDI_CREATE_DEFAULT_INSTANCE();

void setup() {
  MIDI.begin(MIDICH); // Launch MIDI and listen to channel 1
  MIDI.turnThruOn();

  // set output pins
  pinMode(A1, OUTPUT);
  pinMode(A2, OUTPUT);
  pinMode(A3, OUTPUT);
  pinMode(A4, OUTPUT);

  pinMode(B1, OUTPUT);
  pinMode(B2, OUTPUT);
  pinMode(B3, OUTPUT);
  pinMode(B4, OUTPUT);

  pinMode(C1, OUTPUT);
  pinMode(C2, OUTPUT);
  pinMode(C3, OUTPUT);
  pinMode(C4, OUTPUT);

  pinMode(D1, OUTPUT);
  pinMode(D2, OUTPUT);
  pinMode(D3, OUTPUT);

  // set note2pin array
  note2pin[0] = A1;
  note2pin[1] = A2;
  note2pin[2] = A3;
  note2pin[3] = A4;

  note2pin[12] = B1;
  note2pin[13] = B2;
  note2pin[14] = B3;
  note2pin[15] = B4;

  note2pin[24] = C1;
  note2pin[25] = C2;
  note2pin[26] = C3;
  note2pin[27] = C4;

  note2pin[36] = D1;
  note2pin[37] = D2;
  note2pin[48] = D3;
}

void loop() {
  if(MIDI.read()){
      switch(MIDI.getType(){
        case midi::NoteOn:
          pitch = MIDI.getData1();
          vel = MIDI.getData2();
          analogWrite(note2pin[pitch], vel << 1);
        break;

        case midi::NoteOff:
          pitch = MIDI.getData1();
          analogWrite(note2pin[pitch], LOW);
        break;
      }
  }
}

error: pathspec 'Ensembles/EnsembleTwo/firmeware/EnsembleTwo_firmeware/EnsembleTwo_firmeware.ino' did not match any file(s) known to git


Added basic test sketch w/ white color

Added basic test sketch w/ white color

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


Hierarchical job example sketch.

Hierarchical job example sketch.

/**
 * @file CosaJobs.ino
 * @version 1.0
 *
 * @section License
 * Copyright (C) 2015, Mikael Patel
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * @section Description
 * Demonstrate Hierarchical Periodic functions. Periodic LED class
 * will toggle pin for a given number of steps and stop. A Periodic
 * Controller class is used to start the LED. The LED class uses
 * on_expired() for the behavior, while the Controller uses an
 * event and the run() member function.
 *
 * This file is part of the Arduino Che Cosa project.
 */

#include "Cosa/Event.hh"
#include "Cosa/Periodic.hh"
#include "Cosa/OutputPin.hh"

// Configuration; trace and timer source (RTT/Watchdog)
#define USE_TRACE_CONTROLLER
#define USE_RTT_TIMER
// #define USE_WATCHDOG_TIMER

#if defined(USE_TRACE_CONTROLLER)
#include "Cosa/UART.hh"
#include "Cosa/Trace.hh"
#endif

#if defined(USE_RTT_TIMER)
#include "Cosa/RTT.hh"
#define TIMER RTT
#define TIMESTAMP() micros() / 1000
#define MS(ms) ms * 1000L
#endif

#if defined(USE_WATCHDOG_TIMER)
#include "Cosa/Watchdog.hh"
#define TIMER Watchdog
#define TIMESTAMP() millis()
#define MS(ms) ms
#endif

class LED : public Periodic, public OutputPin {
public:
  const uint16_t STEP_MAX;

  LED(Job::Scheduler* scheduler, uint32_t period, uint16_t steps) :
    Periodic(scheduler, period),
    OutputPin(Board::LED, 0),
    STEP_MAX(steps),
    m_step(0),
    m_cycles(0)
  {}

  virtual void on_expired()
  {
    if (m_step < STEP_MAX) {
      toggle();
      m_cycles += 1;
      m_step += 1;
      reschedule();
    }
    else {
      off();
      m_step = 0;
    }
  }

  uint32_t cycles() const
  {
    return (m_cycles);
  }

private:
  uint16_t m_step;
  uint32_t m_cycles;
};

class Controller : public Periodic {
public:
  Controller(Job::Scheduler* scheduler, uint32_t period, LED* led) :
    Periodic(scheduler, period),
    m_led(led)
  {}

  virtual void run()
  {
#if defined(USE_TRACE_CONTROLLER)
    uint32_t timestamp = TIMER::TIMESTAMP();
    uint16_t cycles = m_led->cycles();
#endif
    m_led->expire_at(expire_at());
    m_led->start();
#if defined(USE_TRACE_CONTROLLER)
    trace << timestamp << ':' << cycles << endl;
#endif
  }

private:
  LED* m_led;
};

TIMER::Scheduler scheduler;
LED led(&scheduler, MS(200L), 10);
Controller controller(&scheduler, MS(5000L), &led);

void setup()
{
#if defined(USE_TRACE_CONTROLLER)
  uart.begin(9600);
  trace.begin(&uart, PSTR("CosaJobs: started"));
  trace.flush();
#endif
  controller.start();
  TIMER::begin();
}

void loop()
{
  Event::service();
}

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