Initial add of serial menu/macro based led control program for Arduino

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

--- Arduino/serial_led.ino
+++ Arduino/serial_led.ino
@@ -0,0 +1,929 @@
+ /***********************************************************************
+ *  Copyright (c) 2014 - Matthew Fatheree <greymattr@gmail.com>
+ *  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES.  THE USER(S) ARE HEREBY NOTIFIED THAT USE OF THIS SOFTWARE MAY
+ * MAY CAUSE LOSS OF DATA, DATA DESTRUCTION, HEALTH AND MENTAL PROBLEMS. IT
+ * MAY CAUSE YOU TO START DRINKING, INCREASE YOUR STUPIDITY LEVEL, CLUB
+ * BABY SEALS, AND OVERALL BECOME A BAD PERSON.
+ *
+ * PLEASE USE AT YOUR OWN RISK
+ * ____    ________
+ * \   \  /    ___/
+ * |    \/     __|
+ * |  |\__/|  |
+ * /  \atthew \atheree
+ ************************************************************************/
+
+#include <stdarg.h>
+
+#define	min(a,b)	  ((a) < (b) ? (a) : (b))
+#define	max(a,b)	  ((a) > (b) ? (a) : (b))
+
+#define SET_BIT(p,n)      ((p) |= (1 << (n)))
+#define CLR_BIT(p,n)      ((p) &= (~(1) << (n)))
+#define IS_BIT_SET(val, bit_no) (((val) >> (bit_no)) & 1)
+
+#define INTENSE_MIN        0
+#define INTENSE_MAX        255
+
+
+//#define FADE_STEPS         8
+#define FADE_STEPS         16
+//#define FADE_STEPS         32
+
+#define SL_VERSION         "v0.1.1"
+
+
+
+#define BORDER             "\n--------------------\n"
+#define LED_CHOICE         "Which LED would you like to"
+#define FREQ_CHOICE        "How quickly would you like it to"
+#define REPEAT_CHOICE      "How many times should it"
+#define INTENSE_CHOICE     "How bright"
+#define MODE_SEL_ERR       "mode select error\n"
+#define PARAM_ERR          "parameter error\n"
+
+#define HIGH_VAL_STR       "High Value"
+#define MID_VAL_STR        "Mid Value"
+#define LOW_VAL_STR        "Low Value"
+
+#define CONTROL_SETTINGS   "Control Settings"
+#define START_INTS         "Start Intensity"
+#define END_INTS           "End Intensity"
+#define TXT_MACRO          "\n\n macro = "
+
+
+#define MAX_MACRO_LEN      128
+#define SMALL_BUFF         8
+
+#define LED1_FLAG          1
+#define LED2_FLAG          2
+#define LED3_FLAG          4
+#define LED4_FLAG          8
+#define LED5_FLAG          16
+#define LED6_FLAG          32
+#define LED7_FLAG          64
+#define LED8_FLAG          128
+#define LED9_FLAG          256
+#define LED10_FLAG         512
+#define LED11_FLAG         1024
+#define LED12_FLAG         2048
+#define LED13_FLAG         4096
+
+//macro modes
+#define MODE_BLINK         1
+#define MODE_PULSE         2
+#define MODE_FADE          3
+#define MODE_WAIT          4
+#define MODE_SET           5
+
+#define MAX_LEDS           13
+#define ALL_LEDS           8191
+#define NONE_LEDS          0
+
+#define POWER_SAVE
+
+int HighVal = INTENSE_MAX;
+int MidVal = INTENSE_MAX / 2;
+int LowVal = INTENSE_MIN;
+int UserLed = 10;
+int UserVal = INTENSE_MAX;
+int UserFreq = 1000;
+int UserRepeat = 1;
+int UserState1 = LowVal;
+int UserState2 = HighVal;
+char Uinput[ MAX_MACRO_LEN ];
+
+void setup()
+{
+  int x = 0;
+
+  for( x=0; x<=MAX_LEDS; x++ ) {
+    pinMode( UserLed,OUTPUT );    // Configure the onboard LED for output
+    analogWrite( UserLed,0 );  // default to LED off
+  }
+  Serial.begin( 57600 );
+  while( !Serial ) {
+    delay( 500 );
+  }
+  delay( 1000 ); // because Arduino,... am I right?...
+
+}
+
+void p( char *fmt, ... )
+{
+  char buf[MAX_MACRO_LEN]; // resulting string limited to 128 chars
+  va_list args;
+  va_start ( args, fmt );
+  memset( buf, 0, sizeof( buf ) );
+  vsnprintf( buf, MAX_MACRO_LEN, fmt, args );
+  va_end ( args );
+  Serial.print( buf );
+}
+
+void display_menu()
+{
+  delay( 500 );
+  p( "\n\n    LED %s %s\n", CONTROL_SETTINGS, SL_VERSION );
+  p( " I. Intensity %s\n", CONTROL_SETTINGS );
+  p( " F. Fade  %s\n", CONTROL_SETTINGS );
+  p( " P. Pulse %s\n", CONTROL_SETTINGS );
+  p( " B. Blink %s\n", CONTROL_SETTINGS );
+  p( " C. Clear all LEDS off\n" );
+#if 0
+  p( " M. Macro %s\n", CONTROL_SETTINGS );
+#endif
+  p( "%s", BORDER);
+  p( " > " );
+}
+
+void loop()
+{
+  char *selection;
+  int a = 0;
+  int ok;
+
+  display_menu();
+  selection = get_user_input();
+  memset( Uinput, 0, sizeof( Uinput ) );
+  for( a=0; a<( MAX_MACRO_LEN-1 ); a++ ) {
+    Uinput[a] = ( char ) *( selection + a );
+    if( Uinput[a] == '\0' ) {
+      break;
+    }
+  }
+  switch ( Uinput[0] ) {
+  case 'I':
+  case 'i':
+    IntensityControls();
+    break;
+  case 'F':
+  case 'f':
+    FadeControls();
+    break;
+  case 'P':
+  case 'p':
+    PulseControls();
+    break;
+  case 'B':
+  case 'b':
+    BlinkControls();
+    break;
+  case 'C':
+  case 'c':
+    p( "\n All LEDS OFF\n\n" );
+    a = 8191;
+    p("%s c\n", TXT_MACRO);
+    set_leds( a, 0 );
+    break;
+  case '*':
+    SayHello();
+    break;
+#if 1
+  case 't':
+    // put test functions here
+    unrecognized();
+    break;
+  case 'M':
+  case 'm':
+    //unrecognized();
+    parse_macro( ( char * )( Uinput + 1 ) );
+    break;
+#endif
+  default:
+    unrecognized();
+    break;
+  }
+
+}
+
+
+void set_leds( int leds, int brightness )
+{
+  int x;
+  //p("\nset led(s) %d at %d\n", leds, brightness);
+  for( x=1; x<=MAX_LEDS; x++ ) {
+    if( IS_BIT_SET( leds, x ) ) {
+      analogWrite( x,brightness );
+    }
+  }
+}
+
+void leds_off( int leds )
+{
+  set_leds( leds,0 );
+}
+
+void leds_on( int leds )
+{
+  set_leds( leds,255 );
+}
+
+void blink_leds( int leds, int brightness, int freq, int repeat )
+{
+  int i = 0, x = 0;
+  int led;
+
+  set_leds( leds, 0 );
+  //p( "\n blink led(s) %d at %d/%dms %d times\n", leds, brightness, freq, repeat );
+  for( i=0; i<repeat; i++ ) {
+    set_leds( leds, brightness );
+    delay( freq / 2 );
+    set_leds( leds, 0 );
+    delay( freq/2 );
+  }
+}
+
+void blink_led( int led, int b, int f, int r )
+{
+  int ls = 0;
+  SET_BIT( ls, led );
+  blink_leds( ls, b, f, r );
+}
+
+void fade_leds( int leds, int from, int to, int freq, int repeat )
+{
+  int total_time = freq;
+  int steps = FADE_STEPS;
+  int total_range = ( ( max( from,to ) ) - min( from,to ) );
+  int step_value =  ( total_range / steps );
+  int sleep_value = ( total_time / steps );
+  int i, y;
+  int curval;
+  int led = 0;
+
+  //p( "\n fade led(s) %d from %d to %d/%dms %d times\n", leds, from, to, freq, repeat );
+  for( i=0; i<repeat; i++ ) {
+    curval = from;
+    for ( y=0; y<=steps; y++ ) {
+      if( curval < 0 ) {
+        curval = 0;
+      }
+      set_leds( leds, curval );
+      if( curval > to ) {
+        curval = curval - step_value;
+      } else {
+        curval = curval + step_value;
+      }
+      delay( sleep_value );
+    }
+  }
+  set_leds( leds, to );
+}
+
+void fade_led( int leds, int from, int to, int freq, int repeat )
+{
+  int ls = 0;
+  SET_BIT( ls, leds );
+  fade_leds( ls, from, to, freq, repeat );
+}
+
+
+void pulse_leds( int leds, int from, int to, int freq, int repeat )
+{
+  int i;
+  int new_freq = freq / 2;
+  for( i=0; i<repeat; i++ ) {
+    fade_leds( leds, from, to, new_freq, 1 );
+    fade_leds( leds, to, from, new_freq, 1 );
+  }
+
+}
+
+void pulse_led( int led, int from, int to, int freq, int repeat )
+{
+  int ls = 0;
+  SET_BIT( ls, led );
+  pulse_leds( ls, from, to, freq, repeat );
+}
+
+void SayHello()
+{
+  p( "%s", BORDER );
+  p( "\n Hey Matt... greymattr want a beer?... You're awesome!...\n" );
+  p( "%s", BORDER );
+}
+
+char *get_user_input()
+{
+  int i=0;
+  char b = 0;
+  char commandbuffer[MAX_MACRO_LEN];
+
+  memset( commandbuffer, 0, sizeof( commandbuffer ) );
+  while( i < ( sizeof( commandbuffer )-1 ) ) {
+    if( Serial.available() ) {
+      b = Serial.read();
+      if( b != 0x08 ){
+        commandbuffer[i++] = b;
+      } else {
+        commandbuffer[i] = '\0';
+        i--;
+      }
+      if( ( b == 0x0a ) || ( b== 0x0d ) ) {
+        break;
+      } else {
+        Serial.write( b );
+      }
+    }
+  }
+  if( i<2 ) {
+    return "\0";
+  }
+  commandbuffer[i]='\0';
+  //p("\ncmd buffer = %s\n", commandbuffer);
+  return commandbuffer;
+}
+
+int get_user_int( int orig )
+{
+  char *arg = '\0';
+  int val = 0;
+  arg = get_user_input();
+  if( *arg != '\0' ) {
+    val=atoi( arg );
+    if( ( val >= INTENSE_MIN ) && ( val <= INTENSE_MAX ) ) {
+      return val;
+    } else {
+      return orig;
+    }
+  }
+  return orig;
+}
+
+int get_user_intlarge( int orig )
+{
+  char *arg = '\0';
+  int val = 0;
+  arg = get_user_input();
+  if( *arg != '\0' ) {
+    val=atoi( arg );
+    if( ( val >= 0 ) && ( val <= 0xFFFF ) ) {
+      return val;
+    } else {
+      return orig;
+    }
+  }
+  return orig;
+}
+
+void BlinkControls()
+{
+  int aNumber;
+  char resp;
+  char *arg = '\0';
+  int ok;
+  int val;
+
+  Serial.flush();
+  p( "\n\nBlink %s\n", CONTROL_SETTINGS );
+  p( "%s blink [ %d ]?: ", LED_CHOICE, UserLed );
+  while( !Serial.available() ) {
+    ;
+  }
+  UserLed = get_user_int( UserLed );
+  p( "\n%s blink [ %dms ]?: ", FREQ_CHOICE, UserFreq );
+  while( !Serial.available() ) {
+    ;
+  }
+  UserFreq = get_user_intlarge( UserFreq );
+  p( "\n%s (1-255) [ %d ]?: ", INTENSE_CHOICE, UserVal );
+  while( !Serial.available() ) {
+    ;
+  }
+  UserVal = get_user_int( UserVal );
+  p( "\n%s should it blink [ %d ]?: ", REPEAT_CHOICE, UserRepeat );
+  while( !Serial.available() ) {
+    ;
+  }
+  UserRepeat = get_user_int( UserRepeat );
+  p("%s ml(%d)b(%d,%d,%d)\n", TXT_MACRO,UserLed, UserVal, UserFreq, UserRepeat);
+  blink_led( UserLed, UserVal, UserFreq, UserRepeat );
+}
+
+void IntensityControls()
+{
+  char *arg = NULL;
+  int val = 0;
+  int ok;
+
+  Serial.flush();
+  p( "\n\nIntensity %s ( 1 - 255 )\n", CONTROL_SETTINGS );
+  p( "%s [ %d ]?: ",HIGH_VAL_STR, HighVal );
+  while( !Serial.available() ) {
+    ;
+  }
+  HighVal = get_user_int( HighVal );
+  p( "\n %s [ %d ]?: ",MID_VAL_STR, MidVal );
+  while( !Serial.available() ) {
+    ;
+  }
+  MidVal = get_user_int( MidVal );
+  p( "\n %s [ %d ]?: ",LOW_VAL_STR, LowVal );
+  while( !Serial.available() ) {
+    ;
+  }
+  LowVal = get_user_int( LowVal );
+  p( "%s", BORDER );
+  p( "%s=%d, %s=%d, %s=%d\n",HIGH_VAL_STR,HighVal,MID_VAL_STR, MidVal,LOW_VAL_STR, LowVal );
+  p( "%s", BORDER );
+  p( "\n%s set [ %d ]?: ", LED_CHOICE, UserLed );
+  while( !Serial.available() ) {
+    ;
+  }
+  UserLed = get_user_int( UserLed );
+  p( "\n%s [ %d ]?: ", INTENSE_CHOICE, UserVal );
+  while( !Serial.available() ) {
+    ;
+  }
+  UserVal = get_user_intlarge( UserVal );
+  p( "%s", BORDER );
+  p( "\nLED %d set to %d\n", UserLed, UserVal );
+  p("%s ml(%d)i(%d)\n", TXT_MACRO,UserLed, UserVal);
+  analogWrite( UserLed, UserVal );
+  p( "%s", BORDER );
+}
+
+void intensity_menu()
+{
+  p( "\n a. %s ( %d )\n", HIGH_VAL_STR, HighVal );
+  p( " b.  %s ( %d )\n", MID_VAL_STR, MidVal );
+  p( " c.  %s ( %d )\n", LOW_VAL_STR, LowVal );
+}
+
+void FadeControls()
+{
+  char *arg = '\0';
+  int state1 = UserState1;
+  int state2 = UserState2;
+
+  Serial.flush();
+  p( "\n\nFade %s\n", CONTROL_SETTINGS );
+  p( "%s fade [ %d ]?: ", LED_CHOICE, UserLed );
+  while( !Serial.available() ) {
+    ;
+  }
+  UserLed = get_user_int( UserLed );
+  intensity_menu();
+  p( "%s [ %d ]?: ", START_INTS, UserState1 );
+  while( !Serial.available() ) {
+    ;
+  }
+  arg = get_user_input();
+  switch( *arg ) {
+  case 'A':
+  case 'a':
+    UserState1 = HighVal;
+    break;
+  case 'B':
+  case 'b':
+    UserState1 = MidVal;
+    break;
+  case 'C':
+  case 'c':
+    UserState1 = LowVal;
+    break;
+  default:
+    state1 = atoi( arg );
+    if( ( state1 > 255 ) || ( state1 < 0 ) ) {
+      state1=UserState1;
+    } else {
+      state1 = UserState1;
+    }
+    break;
+  }
+  intensity_menu();
+  p( "%s [ %d ]?: ",END_INTS, UserState2 );
+  while( !Serial.available() ) {
+    ;
+  }
+  arg = get_user_input();
+  switch( *arg ) {
+  case 'A':
+  case 'a':
+    state2 = HighVal;
+    break;
+  case 'B':
+  case 'b':
+    state2 = MidVal;
+    break;
+  case 'c':
+  case 'C':
+    state2 = LowVal;
+    break;
+  default:
+    state2 = atoi( arg );
+    if( ( state2 > 255 ) || ( state2 < 0 ) ) {
+      state2=UserState2;
+    } else {
+      state2 = UserState2;
+    }
+    break;
+  }
+  UserState2 = state2;
+  p( "\n%s fade [ %d ]?: ", FREQ_CHOICE, UserFreq );
+  while( !Serial.available() ) {
+    ;
+  }
+  UserFreq = get_user_intlarge( UserFreq );
+  p( "\n%s fade [ %d ]?: ", REPEAT_CHOICE, UserRepeat );
+  while( !Serial.available() ) {
+    ;
+  }
+  UserRepeat = get_user_int( UserRepeat );
+  p("%s ml(%d)f(%d,%d,%d,%d)\n", TXT_MACRO,UserLed, UserState1, UserState2, UserFreq, UserRepeat);
+  fade_led( UserLed, UserState1, UserState2, UserFreq, UserRepeat );
+}
+
+void PulseControls()
+{
+  char *arg = '\0';
+  int sel = 0;
+  int state1, state2;
+  int ok;
+
+  Serial.flush();
+  p( "\n\nPulse %s\n", CONTROL_SETTINGS );
+  p( "%s Pulse [ %d ]?: ",LED_CHOICE, UserLed );
+  while( !Serial.available() ) {
+    ;
+  }
+  UserLed = get_user_int( UserLed );
+  intensity_menu();
+  p( "%s [ %d ]?: ", START_INTS, UserState1 );
+  while( !Serial.available() ) {
+    ;
+  }
+  arg = get_user_input();
+  switch( arg[0] ) {
+  case 'a':
+  case 'A':
+    state1 = HighVal;
+    break;
+  case 'b':
+  case 'B':
+    state1 = MidVal;
+    break;
+  case 'c':
+  case 'C':
+    state1 = LowVal;
+    break;
+  default:
+    state1 = atoi( arg );
+    if( ( state1 > 255 ) || ( state1 < 0 ) ) {
+      state1=UserState1;
+    } else {
+      state1 = UserState1;
+    }
+    break;
+  }
+  UserState1 = state1;
+  p( "\n%s %d\n", START_INTS, UserState1 );
+  intensity_menu();
+  p( "%s [ %d ]?: ",END_INTS, UserState2 );
+  while( !Serial.available() ) {
+    ;
+  }
+  arg = get_user_input();
+  switch( arg[0] ) {
+  case 'a':
+  case 'A':
+    state2 = HighVal;
+    break;
+  case 'b':
+  case 'B':
+    state2 = MidVal;
+    break;
+  case 'c':
+  case 'C':
+    state2 = LowVal;
+    break;
+  default:
+    state2 = atoi( arg );
+    if( ( state2 > 255 ) || ( state2 < 0 ) ) {
+      state2=UserState2;
+    } else {
+      state2 = UserState2;
+    }
+    break;
+  }
+  UserState2 = state2;
+  p( "\n%s pulse [ %d ]?: ", FREQ_CHOICE, UserFreq );
+  while( !Serial.available() ) {
+    ;
+  }
+  UserFreq=get_user_intlarge( UserFreq );
+  p( "\n%s pulse [ %d ]?: ", REPEAT_CHOICE, UserRepeat );
+  while( !Serial.available() ) {
+    ;
+  }
+  UserRepeat=get_user_int( UserRepeat );
+  p("%s ml(%d)p(%d,%d,%d,%d)\n", TXT_MACRO,UserLed, UserState1, UserState2, UserFreq, UserRepeat);
+  pulse_led( UserLed, UserState1, UserState2, UserFreq, UserRepeat );
+}
+
+int parse_macro( char *macro )
+{
+  int ok = 0;
+  long int leds = 0;
+  char *ch;
+  char buf[ SMALL_BUFF ];
+  int val1 = -1;
+  int val2 = -1;
+  int freq = -1;
+  int repeat = -1;
+  int wait = -1;
+  int state = 0;
+  int i, x;
+  int scratch = 0;
+  int mode = 0;
+
+  set_leds( ALL_LEDS, 0 );
+  p( "\nRun Macro [ %s ]\n", macro-1 );
+  for( i=0; i<( MAX_MACRO_LEN - 1 ); i++ ) {
+    ch = ( char * )( macro + i );
+    switch( *ch ) {
+    case 'l':
+    case 'L':
+      leds = 0;
+      if( *( ch + 1 ) == '(' ) {
+        i++;  // skip char
+        memset( buf, 0, sizeof( buf ) );
+        for( x=0; x<sizeof( buf ); x++ ) {
+          i++;
+          ch = ( char * )( macro + i );
+          switch( *ch ) {
+          case ',':
+          case ')':
+            scratch = atoi( buf );
+            //p("got led #%d\n", scratch);
+            SET_BIT( leds, scratch );
+            if( *ch == ')' ) {
+              for( x=0; x<MAX_LEDS; x++ ) {
+                if( IS_BIT_SET( leds, x ) ) {
+                  p( "+ LED #%d\n", x );
+                }
+              }
+              x = sizeof( buf ); // stop here
+            } else {
+              memset( buf, 0, sizeof( buf ) );
+              x = -1;
+            }
+            break;
+          default:
+            buf[x] = *ch;
+            //p("buf[%d] = %c\n", x, *ch);
+            break;
+          }
+        }
+      } else {
+        p( "LED err: %s", PARAM_ERR );
+        ok = -1;
+      }
+      //leds = 0;
+      val1 = -1;
+      val2 = -1;
+      freq = -1;
+      wait = - 1;
+      repeat = -1;
+      mode = 0;
+      break;
+    case 'b':
+    case 'B':
+      i++;
+      if( mode == 0 ) {
+        p("\nBlink\n");
+        mode = MODE_BLINK;
+      } else {
+        p( "%s",MODE_SEL_ERR );
+      }
+      for( x=0; x<sizeof( buf ); x++ ) {
+        i++;
+        ch = ( char * )( macro + i );
+        switch( *ch ) {
+        case ',':
+        case ')':
+          scratch = atoi( buf );
+          //p("got led #%d\n", scratch);
+          if( val1 == -1 ) {
+            p( "got %s %d\n", END_INTS, scratch );
+            val1 = scratch;
+            x = -1;
+          } else {
+            if( freq == -1 ) {
+              p( "got frequency %d\n", scratch );
+              freq = scratch;
+              x = -1;
+            } else {
+              if( repeat == -1 ) {
+                p( "got repeat %d\n", scratch );
+                repeat = scratch;
+                blink_leds( leds, val1, freq, repeat );
+                x = sizeof( buf );
+              } else {
+                p( "Blink set %s", PARAM_ERR );
+              }
+            }
+          }
+          memset( buf, 0, sizeof( buf ) );
+          break;
+        default:
+          buf[x] = *ch;
+          //p("buf[%d] = %c\n", x, *ch);
+          break;
+        }
+      }
+      //leds = 0;
+      val1 = -1;
+      val2 = -1;
+      freq = -1;
+      wait = - 1;
+      repeat = -1;
+      mode = 0;
+      break;
+    case 'f':
+    case 'F':
+    case 'p':
+    case 'P':
+      i++;
+      if( mode == 0 ) {
+        if( ( *ch == 'f' ) || ( *ch == 'F' ) ) {
+          mode = MODE_FADE;
+          p( "\nFade\n" );
+        } else {
+          mode = MODE_PULSE;
+          p( "\nPulse\n" );
+        }
+      } else {
+        p( "%s",MODE_SEL_ERR );
+      }
+      for( x=0; x<sizeof( buf ); x++ ) {
+        i++;
+        ch = ( char * )( macro + i );
+        switch( *ch ) {
+        case ',':
+        case ')':
+          scratch = atoi( buf );
+          //p("got led #%d\n", scratch);
+          if( val1 == -1 ) {
+            p( "got %s %d\n",START_INTS, scratch );
+            val1 = scratch;
+            x = -1;
+          } else {
+            if ( val2 == -1 ) {
+              p( "got %s %d\n",END_INTS, scratch );
+              val2 = scratch;
+              x = -1;
+            } else {
+              if( freq == -1 ) {
+                p( "got frequency %d\n", scratch );
+                freq = scratch;
+                x = -1;
+              } else {
+                if( repeat == -1 ) {
+                  p( "got repeat %d\n", scratch );
+                  repeat = scratch;
+                  if( mode == MODE_FADE ) {
+                    fade_leds( leds, val1, val2, freq, repeat );
+                  } else {
+                    pulse_leds( leds, val1, val2, freq, repeat );
+                  }
+                  x = sizeof( buf );
+                } else {
+                  p( "set %s", PARAM_ERR );
+                }
+              }
+            }
+          }
+          memset( buf, 0, sizeof( buf ) );
+          break;
+        default:
+          buf[x] = *ch;
+          //p("buf[%d] = %c\n", x, *ch);
+          break;
+        }
+      }
+      //leds = 0;
+      val1 = -1;
+      val2 = -1;
+      freq = -1;
+      wait = - 1;
+      repeat = -1;
+      mode = 0;
+      break;
+    case 'i':
+    case 'I':
+      if( mode == 0 ) {
+        mode = MODE_SET;
+        p( "\nIntensity\n" );
+      } else {
+        p( "%s",MODE_SEL_ERR );
+      }
+      i++;
+      mode = MODE_SET;
+      memset( buf,0, sizeof( buf ) );
+      for( x=0; x<sizeof( buf ); x++ ) {
+        i++;
+        ch = ( char * )( macro + i );
+        switch( *ch ) {
+        case ')':
+          if( freq == -1 ) {
+            scratch = atoi( buf );
+            p( "got %s %d\n", END_INTS, scratch );
+            val1 = scratch;
+            set_leds( leds, val1 );
+            x = sizeof( buf );
+          } else {
+            p( "intensity %s", PARAM_ERR );
+          }
+          break;
+        default:
+          buf[x] = *ch;
+          break;
+        }
+      }
+      //leds = 0;
+      val1 = -1;
+      val2 = -1;
+      freq = -1;
+      wait = - 1;
+      repeat = -1;
+      mode = 0;
+      break;
+    case 'w':
+    case 'W':
+      if( ( mode == 0 ) &&  ( *( ch+1 ) == '(' ) ) {
+        i++;
+        p( "\nWait\n" );
+        mode = MODE_WAIT;
+        memset( buf,0, sizeof( buf ) );
+        for( x=0; x<sizeof( buf ); x++ ) {
+          i++;
+          ch = ( char * )( macro + i );
+          switch( *ch ) {
+          case ')':
+            if( freq == -1 ) {
+              scratch = atoi( buf );
+              p( "got freq %d\n", scratch );
+              freq = scratch;
+              delay( freq );
+              x = sizeof( buf );
+            } else {
+              p( "Wait set %s", PARAM_ERR );
+            }
+            break;
+          default:
+            buf[x] = *ch;
+            break;
+          }
+        }
+      } else {
+        p( "%s",MODE_SEL_ERR );
+      }
+      //leds = 0;
+      val1 = -1;
+      val2 = -1;
+      freq = -1;
+      wait = - 1;
+      repeat = -1;
+      mode = 0;
+      break;
+    case 'c':
+    case 'C':
+      i++;
+      p( "Clear\n" );
+      set_leds( ALL_LEDS, 0 );
+      //leds = 0;
+      val1 = -1;
+      val2 = -1;
+      freq = -1;
+      wait = - 1;
+      repeat = -1;
+      mode = 0;
+      break;
+    }
+  }// end of loop through macro
+  //p("led = %d\n", leds );
+  return ok;
+}
+
+void unrecognized()
+{
+  p( "\nError!\n" );
+}
+


Restored arduino file

Restored arduino file

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

--- arduino/arduino.ino
+++ arduino/arduino.ino
@@ -0,0 +1,39 @@
+int led = 0;
+
+char incomingByte = 0;
+char message[4];
+int index = 0;
+
+void setup() {
+  Serial.begin(9600);
+  pinMode(led, OUTPUT);
+}
+
+void readMessage() {
+  while(Serial.available() > 0) {
+    incomingByte = Serial.read();
+    message[index++] = incomingByte;
+    message[index] = '\0';
+  }
+}
+
+void cleanMessage() {
+  message[(index = 0)] = '\0';
+}
+
+void loop() {
+  readMessage();
+  if(strcmp(message,"REQ")  == 0) {
+    Serial.println(analogRead(A0));
+  } else if (strcmp(message,"ON")  == 0) {
+    digitalWrite(led, HIGH);
+    Serial.println("OK");
+  } else if (strcmp(message,"OFF")  == 0) {
+    digitalWrite(led, LOW);
+    Serial.println("OK");
+  } else if(message[0] != '\0') {
+    Serial.println("NOK");
+  }
+  cleanMessage();
+}
+


Program to accept slope and intercept and return data mapped to 1023

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

--- VernierDetermineSlopeIntercept/VernierDetermineSlopeIntercept.ino
+++ VernierDetermineSlopeIntercept/VernierDetermineSlopeIntercept.ino
@@ -0,0 +1,58 @@
+/*
+VernierDetermineSlopeIntercept (v 2015.02)
+Reads a Vernier analog (BTA) Sensor connected to pin A0 of the Arduino.
+This sketch displays the time and digital readout from the sensor
+readings on the Serial Monitor.
+As written, the readings will be displayed every half second.
+Change the variable TimeBetweenReadings to change the rate.
+
+ See www.vernier.com/arduino for more information.
+*/
+/*
+////////////////////////////////////////
+The data from this sketch will allow you to determine the slope and
+intercept of the sensor - assuming a linear relationship. Once this
+is determined another sketch called "VernierAnalog Sensor" can be used
+to read values of the sensor.
+//See www.vernier.com/products/sensors.
+*/
+int TimeBetweenReadings = 500; // in ms
+float Count;
+float Voltage;
+float SensorReading;
+int ReadingNumber=0;
+float Time;
+/////////////////////////////////////////
+
+void setup()
+{
+  Serial.begin(9600); //initialize serial communication at 9600 baud
+  Serial.println("Vernier Format Special");
+  Serial.println("Readings taken using Ardunio to determine slope and intercept");
+  Serial.println("Data Set");
+  Serial.print("Time");//long name
+  Serial.print("\t"); //tab character
+  Serial.print("(s)");//units
+  Serial.print("\t");
+  Serial.print("Count");
+  Serial.print("\t");
+  Serial.print("Voltage");
+  Serial.print("\t");
+  Serial.println("(V)");
+}
+void loop()
+{
+
+//the print below does the division first to avoid overflows
+  Serial.print("\t");
+  Serial.print(ReadingNumber/1000.0*TimeBetweenReadings);
+  Serial.print("\t");
+  Count = analogRead(A0);
+  Voltage = Count / 1023 * 5.0;// convert from count to raw voltage
+  Serial.print (Count);
+  Serial.print ("\t");
+  Serial.println (Voltage);
+  delay(TimeBetweenReadings);// delay in between reads for stability
+  ReadingNumber++;
+}
+


Fixed bug where skyprobe test would hang.

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


added arduino source code

added arduino source code

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

--- arduino/pi_rover/pi_rover.ino
+++ arduino/pi_rover/pi_rover.ino
@@ -0,0 +1,142 @@
+#include <AFMotor.h>
+
+AF_DCMotor motor1(1);
+AF_DCMotor motor2(2);
+AF_DCMotor motor3(3);
+AF_DCMotor motor4(4);
+
+int motorSpeed = 200;
+
+String command = "";
+
+void setup()
+{
+  Serial.begin(9600);
+  Serial.print("Ready\n");
+}
+
+void loop()
+{
+  char character;
+
+  while(Serial.available()) {
+    character = Serial.read();
+    command.concat(character);
+  }
+
+  if (command != "") {
+    String result = handleCommand(command);
+    Serial.print(result + "\n");
+    command = "";
+  }
+
+  delay(250);
+}
+
+String handleCommand(String command) {
+  String result;
+
+  if(command == "check battery status") {
+    result = checkBatteryStatus();
+  } else if(command == "forward") {
+    result = forward();
+  } else if(command == "backward") {
+    result = backward();
+  } else if(command == "left") {
+    result = left();
+  } else if(command == "right") {
+    result = right();
+  } else if(command == "stop") {
+    result = halt();
+  } else {
+    result = "unknown command: " + command;
+  }
+
+  return result;
+}
+
+String forward()
+{
+  turnMotorsOn();
+
+  motor1.run(BACKWARD);
+  motor2.run(BACKWARD);
+  motor3.run(FORWARD);
+  motor4.run(FORWARD);
+
+  return "ok";
+}
+
+String backward()
+{
+  turnMotorsOn();
+
+  motor1.run(FORWARD);
+  motor2.run(FORWARD);
+  motor3.run(BACKWARD);
+  motor4.run(BACKWARD);
+
+  return "ok";
+}
+
+String halt()
+{
+  turnMotorsOff();
+
+  return "ok";
+}
+
+
+
+String left()
+{
+  turnMotorsOn();
+
+  motor1.run(FORWARD);
+  motor2.run(BACKWARD);
+  motor3.run(FORWARD);
+  motor4.run(BACKWARD);
+
+  delay(250);
+
+  turnMotorsOff();
+
+  return "ok";
+}
+
+String right()
+{
+  turnMotorsOn();
+
+  motor1.run(BACKWARD);
+  motor2.run(FORWARD);
+  motor3.run(BACKWARD);
+  motor4.run(FORWARD);
+
+  delay(250);
+
+  turnMotorsOff();
+
+  return "ok";
+}
+
+String checkBatteryStatus()
+{
+  return "battery status is " + String(random(0, 1));
+}
+
+void turnMotorsOff()
+{
+  motor1.setSpeed(0);
+  motor2.setSpeed(0);
+  motor3.setSpeed(0);
+  motor4.setSpeed(0);
+}
+
+void turnMotorsOn()
+{
+  motor1.setSpeed(motorSpeed);
+  motor2.setSpeed(motorSpeed);
+  motor3.setSpeed(motorSpeed);
+  motor4.setSpeed(motorSpeed);
+}


that is a sceleton of the movement control

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


Basic Arduino Sketch setup and initialising the project

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

--- src/Arduino/LED_CUBE/LED_CUBE.ino
+++ src/Arduino/LED_CUBE/LED_CUBE.ino
@@ -0,0 +1,70 @@
+/*
+  Pin Settings
+*/
+const int DS_pin = 8;
+const int STCP_pin = 9;
+const int SHCP_pin = 10;
+
+const int MR_pin = 7;
+
+/*
+  Init the System
+*/
+void setup(){
+  // initialize serial:
+  Serial.begin(9600);
+
+  pinMode(DS_pin, OUTPUT);
+  pinMode(STCP_pin, OUTPUT);
+  pinMode(SHCP_pin, OUTPUT);
+  pinMode(MR_pin, OUTPUT);
+
+  writeShift();
+}
+
+/*
+  Stores the Values of the registers
+*/
+boolean shiftRegValues[32];
+
+/*
+  Writes the content of the shift register value array out.
+*/
+void writeShift(){
+  Serial.println("-->writeShift");
+  Serial.print("-->");
+
+  digitalWrite(SHCP_pin, LOW);
+
+  for(int i = 31; i >= 0; i--){
+    Serial.print(shiftRegValues[i]);
+
+    digitalWrite(STCP_pin, LOW);
+    digitalWrite(DS_pin, shiftRegValues[i]);
+    digitalWrite(STCP_pin, HIGH);
+  }
+
+  Serial.println("");
+
+  digitalWrite(SHCP_pin, HIGH);
+}
+
+/*
+  Main LOOP
+*/
+void loop(){
+  // Reset the shift registers
+  digitalWrite(MR_pin, LOW);
+  digitalWrite(MR_pin, HIGH);
+
+  // DO some magic
+
+  writeShift();
+  delay(500);
+
+}
+
+
+
+
+


Switch to hardware MIDI

Switch to hardware MIDI

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


Add code to read temperature and light to display on a LCD

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

--- temp_and_light_lcd/temp_and_light_lcd.ino
+++ temp_and_light_lcd/temp_and_light_lcd.ino
@@ -0,0 +1,43 @@
+/*
+ * Read temperature and light and display on the LCD
+ *
+ * For: Arduino Uno R3
+ *
+ * Parts:
+ * 1x LCD (16x2 characters)
+ * 1x 10 kΩ variable resistor
+ * 1x 10 KΩ resistor
+ * 1x 220 Ω resitor
+ * 1x Photocell
+ * 1x TMP36 temperature sensor
+ */
+#include <LiquidCrystal.h>
+
+int temperaturePin = 0;
+int lightPin = 1;
+
+LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
+
+void setup() {
+  // Set columns and rows to use
+  lcd.begin(16, 2);
+  // Start on the first row
+  lcd.print("Temp :      C");
+}
+
+void loop() {
+  int temperatureReading = analogRead(temperaturePin);
+  float temperatureInVolts = (temperatureReading / 1024.0) * 5.0;
+  float temperatureInCelcius = (temperatureInVolts - 0.5) * 100;
+  // Jump 6 columns
+  lcd.setCursor(6, 0);
+  lcd.print(temperatureInCelcius);
+
+  int lightReading = analogRead(lightPin);
+  // Jump to the next row
+  lcd.setCursor(0, 1);
+  lcd.print("Light:           ");
+  lcd.setCursor(6, 1);
+  lcd.print(lightReading);
+  delay(1000);
+}


add code arduino

add code arduino

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

--- code_arduino/code_arduino.ino
+++ code_arduino/code_arduino.ino
@@ -0,0 +1,50 @@
+#include <Servo.h>
+
+int octetReception=0;
+long nombreReception=0;
+
+const int posMin=500;
+const int posMax=2300;
+
+const int brocheServo1=10;
+const int brocheServo2=9;
+
+Servo servo1;
+Servo servo2;
+
+int angleServo1=0;
+int angleServo2=0;
+
+void setup() {
+  Serial.begin(115200);
+  servo1.attach(brocheServo1, posMin, posMax);
+  servo2.attach(brocheServo2, posMin, posMax);
+}
+
+void loop() {
+  while (Serial.available()>0) {
+    octetReception=Serial.read();
+    if (octetReception==10 || octetReception==44) {
+      Serial.print ("Nombre recu = ");
+      Serial.println (nombreReception);
+      if (octetReception==44){
+        angleServo1=nombreReception;
+      }
+      else{
+        angleServo2=nombreReception;
+      }
+      servo2.write(angleServo2);
+      servo1.write(angleServo1);
+      nombreReception=0;
+      delay(10);
+      break;
+    }
+    else {
+      octetReception=octetReception-48;
+      if ((octetReception>=0)&&(octetReception<=9))
+      nombreReception = (nombreReception*10)+octetReception;
+      else Serial.println("La chaine n'est pas un nombre valide !");
+      delay(1);
+    }
+  }
+}


Enable ROS Subscriber to allow rpi control of LIDAR servo

Needs work... That is, it needs the requisite libraries installed and it needs to actually be tested because it probably won't work :frowning:

error: pathspec 'LIDAR' did not match any file(s) known to git
error: pathspec 'Data' did not match any file(s) known to git
error: pathspec 'Extraction/LidarCommands/Currently' did not match any file(s) known to git
error: pathspec 'Used/lidar_servo_driver/lidar_servo_driver.ino' did not match any file(s) known to git


Added arduino stuff

Added arduino stuff

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

--- arduino_code/motor.ino
+++ arduino_code/motor.ino
@@ -0,0 +1,87 @@
+#define STEP 6
+#define DIR 5
+#define DISABLE 7
+
+#define ROT_PER_SEC 2.5
+#define STEP_PER_ROT 100
+#define USEC_PER_STEP_2 (1000000UL/(ROT_PER_SEC * STEP_PER_ROT * 2))
+
+static inline void step() {
+  digitalWrite(STEP, 1);
+  delayMicroseconds(USEC_PER_STEP_2);
+  digitalWrite(STEP, 0);
+  delayMicroseconds(USEC_PER_STEP_2);
+}
+
+static inline void steps(int8_t n) {
+  if(n < 0) {
+    n = -n;
+    digitalWrite(DIR, 1);
+  } else {
+    digitalWrite(DIR, 0);
+  }
+
+  while(n--) {
+    step();
+  }
+}
+
+void setup() {
+  Serial.begin(9600);
+  pinMode(STEP, OUTPUT);
+  pinMode(DIR, OUTPUT);
+  pinMode(DISABLE, OUTPUT);
+
+  digitalWrite(DISABLE, 1);
+
+  Serial.write("Ready.\r\n");
+}
+
+int r = 0;
+
+void loop() {
+  if(Serial.available()) {
+    int c = Serial.read();
+    if(c == '.') {
+      r = 0;
+      step();
+    }
+    if(c >= '0' && c <= '9') {
+      r = r * 10 + c - '0';
+    }
+    if(c == '\r') {
+      while(r > 0) {
+        digitalWrite(DISABLE, 0);
+        delay(50);
+        steps(STEP_PER_ROT*5/8);
+        delay(10);
+        steps(-STEP_PER_ROT/2);
+        delay(10);
+        steps(STEP_PER_ROT/8);
+        delay(10);
+        steps(-STEP_PER_ROT/2-STEP_PER_ROT/8);
+        delay(50);
+        steps(STEP_PER_ROT-STEP_PER_ROT*5/8);
+        delay(100);
+
+        steps(-STEP_PER_ROT*3/8);
+        delay(50);
+        steps(STEP_PER_ROT);
+        delay(50);
+        steps(-STEP_PER_ROT+STEP_PER_ROT*3/8);
+
+        r--;
+      }
+      delay(500);
+      digitalWrite(DISABLE, 1);
+      r = 0;
+    }
+
+    if(c != '\n') {
+      Serial.write(c);
+      if(c == '\r') {
+        Serial.write('\n');
+      }
+    }
+  }
+}


arduino: adding the arduino code

arduino: adding the arduino code

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

--- src/arduino/sign.ino
+++ src/arduino/sign.ino
@@ -0,0 +1,45 @@
+int redPin = 9;
+int greenPin = 10;
+int bluePin = 11;
+
+void setup()
+{
+  Serial.begin(9600);
+  pinMode(redPin, OUTPUT);
+  pinMode(greenPin, OUTPUT);
+  pinMode(bluePin, OUTPUT);
+}
+
+void setColor(String& color) {
+  long number = strtol( &color[0], NULL, 16);
+
+  long r = number >> 16;
+  long g = number >> 8 & 0xFF;
+  long b = number & 0xFF;
+
+  // ---------------------------------
+  // PNP transistors controls the values
+  // 0v (base pin) => 5v (emitter pin);
+  // 5v (base pin) => 0v (emitter pin);
+  // so i need to patch the values (or to use NPN transistors)
+
+  r = 255 - r;
+  g = 255 - g;
+  b = 255 - b;
+  // ---------------------------------
+
+  analogWrite(redPin, r);
+  analogWrite(greenPin, g);
+  analogWrite(bluePin, b);
+}
+
+void loop()
+{
+  if (Serial.available()) {
+    delay(100);
+    while (Serial.available() > 0) {
+      String color = Serial.readString();
+      setColor(color);
+    }
+  }
+}


Refactor / code cleanup

Refactor / code cleanup

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


Initial commit

Initial commit

Arduino sketch for the joystick

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

--- GunJoystick.ino
+++ GunJoystick.ino
@@ -0,0 +1,178 @@
+
+#include <MPU6050.h>
+#include <I2Cdev.h>
+
+// Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation
+// is used in I2Cdev.h
+#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
+    #include "Wire.h"
+#endif
+
+// class default I2C address is 0x68
+// specific I2C addresses may be passed as a parameter here
+// AD0 low = 0x68 (default for InvenSense evaluation board)
+// AD0 high = 0x69
+MPU6050 accelgyro;
+//MPU6050 accelgyro(0x69); // <-- use for AD0 high
+
+int16_t ax, ay, az;
+int16_t gx, gy, gz;
+int jx, jy;
+
+
+// uncomment "OUTPUT_READABLE_ACCELGYRO" if you want to see a tab-separated
+// list of the accel X/Y/Z and then gyro X/Y/Z values in decimal. Easy to read,
+// not so easy to parse, and slow(er) over UART.
+#define OUTPUT_READABLE_ACCELGYRO
+
+// uncomment "OUTPUT_BINARY_ACCELGYRO" to send all 6 axes of data as 16-bit
+// binary, one right after the other. This is very fast (as fast as possible
+// without compression or data loss), and easy to parse, but impossible to read
+// for a human.
+//#define OUTPUT_BINARY_ACCELGYRO
+
+
+#define LED_PIN 13
+#define BUTTON_PIN 2
+
+bool blinkState = false;
+int buttonState = LOW;
+
+int JOYSTICK_PIN_X = A0;
+int JOYSTICK_PIN_Y = A1;
+
+void setup() {
+    // join I2C bus (I2Cdev library doesn't do this automatically)
+    #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
+        Wire.begin();
+    #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE
+        Fastwire::setup(400, true);
+    #endif
+
+    // initialize serial communication
+    // (38400 chosen because it works as well at 8MHz as it does at 16MHz, but
+    // it's really up to you depending on your project)
+    Serial.begin(38400);
+
+    // initialize device
+    Serial.println("Initializing I2C devices...");
+    accelgyro.initialize();
+
+    // verify connection
+    Serial.println("Testing device connections...");
+    Serial.println(accelgyro.testConnection() ? "MPU6050 connection successful" : "MPU6050 connection failed");
+
+    // use the code below to change accel/gyro offset values
+
+    Serial.println("Updating internal sensor offsets...");
+    // 2426;681;92;-40;22;-42
+    Serial.print(accelgyro.getXAccelOffset()); Serial.print("\t"); // -76
+    Serial.print(accelgyro.getYAccelOffset()); Serial.print("\t"); // -2359
+    Serial.print(accelgyro.getZAccelOffset()); Serial.print("\t"); // 1688
+    Serial.print(accelgyro.getXGyroOffset()); Serial.print("\t"); // 0
+    Serial.print(accelgyro.getYGyroOffset()); Serial.print("\t"); // 0
+    Serial.print(accelgyro.getZGyroOffset()); Serial.print("\t"); // 0
+    Serial.print("\n");
+    accelgyro.setXAccelOffset(-1923);
+    accelgyro.setYAccelOffset(-662);
+    accelgyro.setZAccelOffset(1835);
+    accelgyro.setXGyroOffset(46);
+    accelgyro.setYGyroOffset(-11);
+    accelgyro.setZGyroOffset(44);
+    Serial.print(accelgyro.getXAccelOffset()); Serial.print("\t"); // -76
+    Serial.print(accelgyro.getYAccelOffset()); Serial.print("\t"); // -2359
+    Serial.print(accelgyro.getZAccelOffset()); Serial.print("\t"); // 1688
+    Serial.print(accelgyro.getXGyroOffset()); Serial.print("\t"); // 0
+    Serial.print(accelgyro.getYGyroOffset()); Serial.print("\t"); // 0
+    Serial.print(accelgyro.getZGyroOffset()); Serial.print("\t"); // 0
+    Serial.print("\n");
+
+
+    // configure Arduino LED for
+    pinMode(LED_PIN, OUTPUT);
+    pinMode(BUTTON_PIN, INPUT);
+}
+
+void loop() {
+    delay(100); // delay read for 100 ms
+
+	if(Serial)
+	{
+		// read raw accel/gyro measurements from device
+		accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
+
+		// these methods (and a few others) are also available
+		//accelgyro.getAcceleration(&ax, &ay, &az);
+		//accelgyro.getRotation(&gx, &gy, &gz);
+
+		// convert the raw accelerometer data into a range from -1 to 1 for Unity to consume
+		float pax = 1.0 * (ax / 20000.0);
+		float pay = 1.0 * (ay / 20000.0);
+		float paz = 1.0 * (az / 20000.0);
+
+		// capture joystick input from the analog
+		jx = analogRead(JOYSTICK_PIN_X);
+		jy = analogRead(JOYSTICK_PIN_Y);
+
+		//convert the raw analog joystick data into a range from -1 to 1 for Unity to consume
+		float pjx = ConvertRawValue(jx);
+		float pjy = ConvertRawValue(jy);
+
+		bool buttonState = digitalRead(BUTTON_PIN);
+		digitalWrite(LED_PIN, buttonState);
+
+    #ifdef OUTPUT_READABLE_ACCELGYRO
+        // display tab-separated accel/gyro x/y/z values
+        Serial.print("a;");
+        Serial.print(pax); Serial.print(";");
+        Serial.print(pay); Serial.print(";");
+        Serial.print(paz); Serial.print(";");
+        Serial.print(gx); Serial.print(";");
+        Serial.print(gy); Serial.print(";");
+        Serial.println(gz);
+        Serial.print("j;");
+        Serial.print(pjx); Serial.print(";");
+        Serial.print(pjy); Serial.println();
+        Serial.print("b;"); Serial.print(buttonState); Serial.println();
+    #endif
+
+    #ifdef OUTPUT_BINARY_ACCELGYRO
+        //Serial.write((uint8_t)(ax >> 8)); Serial.write((uint8_t)(ax & 0xFF));
+        //Serial.write((uint8_t)(ay >> 8)); Serial.write((uint8_t)(ay & 0xFF));
+        //Serial.write((uint8_t)(az >> 8)); Serial.write((uint8_t)(az & 0xFF));
+        //Serial.write((uint8_t)(gx >> 8)); Serial.write((uint8_t)(gx & 0xFF));
+        //Serial.write((uint8_t)(gy >> 8)); Serial.write((uint8_t)(gy & 0xFF));
+        //Serial.write((uint8_t)(gz >> 8)); Serial.write((uint8_t)(gz & 0xFF));
+    #endif
+
+    }
+	else
+	{
+		Serial.flush();
+	}
+
+
+    // blink LED to indicate activity
+    //blinkState = !blinkState;
+    //digitalWrite(LED_PIN, buttonState);
+}
+
+float ConvertRawValue(float rawValue)
+{
+    if (rawValue < 512 && rawValue > 0)
+    {
+        return -1.0 - (-1.0 * (rawValue / 512));
+    }
+    else if (rawValue > 512 && rawValue < 1024)
+    {
+        return 1.0 - (1.0 * ((1024 - rawValue) / 512));
+    }
+    else if (rawValue == 0)
+    {
+        return -1.0;
+    }
+    else if (rawValue == 1024)
+    {
+        return 1.0;
+    }
+}


Added arduino sketch, waiting for special input to activate LED.

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

--- sketch/sketch.ino
+++ sketch/sketch.ino
@@ -0,0 +1,29 @@
+
+    int led = 13; // LED connected to digital pin 13
+    int recv = 0; // byte received on the serial port
+
+    void setup() {
+      // initialize onboard LED (led) and serial port
+      pinMode(led, OUTPUT);
+      Serial.begin(9600);
+    }
+
+    void loop()
+    {
+      // if serial port is available, read incoming bytes
+      if (Serial.available() > 0) {
+        recv = Serial.read();
+
+        // if 'x' (decimal 120) is received, turn LED on
+        // anything other than 120 is received, turn LED off
+        if (recv == 120){
+          digitalWrite(led, HIGH);
+        } else {
+          digitalWrite(led, LOW);
+        }
+
+        // confirm values received in serial monitor window
+        Serial.print("--Arduino received: ");
+        Serial.println(recv);
+      }
+    }


Create SerialHello.ino

Create SerialHello.ino

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

--- src/Hello/SerialHello.ino
+++ src/Hello/SerialHello.ino
@@ -0,0 +1,8 @@
+void setup() {
+  Serial.begin(9600);
+}
+
+void loop() {
+  delay(1000);
+  Serial.println("Hello World!");
+}


Valor do vot

Valor do vot

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/ciandt-dev/garage-kelvin-celsius.git/'


Loop program implemented

Loop program implemented

Irrigation Loop implemented

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


support for RevE board

support for RevE board

Flipping the display and changing of pinouts for switch

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

--- Code/ESP32_oled_nav_neo_touch_RevE/ESP32_oled_nav_neo_touch_RevE.ino
+++ Code/ESP32_oled_nav_neo_touch_RevE/ESP32_oled_nav_neo_touch_RevE.ino
@@ -0,0 +1,149 @@
+/*
+ * OLED, nav button, neopixels
+ *
+ * For ESP32-WROOM board (OLED, battery, full pin breakout) and custom PCB
+ * Don't forget to turn the device on, or it won't show up in the port list
+ * If UART disappears from port list, change board to UNO and attach an UNO
+ *
+ * Board:   Wemos Wifi&Bluetooth Battery
+ * Flash:   80Mhz
+ * Upload:  921600
+ * Port:    cu.SLAB_USBtoUART
+ * Prog:    AVRISPmkII
+ *
+ * ESP pins to watch out for:
+ * 4,5          OLED
+ * 0,2,5,12,15  Strapping pins (boot-related)
+ * 34,35        Input-only
+ *
+ */
+
+//this is inside the required library U8g2
+#include <U8x8lib.h>
+#include <Adafruit_NeoPixel.h>
+#ifdef __AVR__
+  #include <avr/power.h>
+#endif
+
+// OLED
+U8X8_SSD1306_128X64_NONAME_SW_I2C u8x8(/* clock=*/ 4, /* data=*/ 5, /* reset=*/U8X8_PIN_NONE );
+
+// Neopixels
+#define PIN       17
+#define NUMPIXELS 10
+Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
+//int delayval = 500;
+
+const int led = 16;
+//int navBtn = 0;
+
+// Nav button
+const int buttonPin1 = 18;   // right
+const int buttonPin2 = 16;   // select
+const int buttonPin3 = 23;   // up
+const int buttonPin4 = 19;   // down
+const int buttonPin5 = 14;   // left
+
+// https://github.com/Serpent999/ESP32_Touch_LED/blob/master/Touch_LED/Touch_LED.ino
+int buff(int pin){
+  int out = (25 - touchRead(pin));             //  adjust touch sensitivity here
+  if (out > 0 ){
+    return (out + 2);
+  }else{
+    return 0;
+  }
+}
+
+void setup() {
+  Serial.begin(9600);
+  pinMode(led, OUTPUT);
+  u8x8.begin();
+  u8x8.setFont(u8x8_font_pxplusibmcga_r);
+  //u8x8.setFlipMode(1);        //remove if screen is flipped
+
+  pinMode(buttonPin1, INPUT);
+  pinMode(buttonPin2, INPUT);
+  pinMode(buttonPin3, INPUT);
+  pinMode(buttonPin4, INPUT);
+  pinMode(buttonPin5, INPUT);
+
+  strip.begin();              // This initializes the NeoPixel library
+  strip.show();               // Begin with all LEDs turned off
+  strip.setBrightness(5);     // These goddamn things are bright
+
+
+}
+
+void loop(){
+
+  pollMenu();
+
+/*
+  digitalWrite(led,LOW);  //onboard LED is on when pulled LOW
+  delay(100);
+  digitalWrite(led,HIGH);
+*/
+
+  //delay(3000);
+
+}
+
+void pollMenu(){
+
+  // LOW is button pressed
+  u8x8.setFont(u8x8_font_victoriamedium8_u);
+
+  // Center button
+  if(digitalRead(buttonPin2) == 0){
+    u8x8.drawString(0,0,"X BUTTON");
+    chase(strip.Color(0, 255, 0));
+  }else{
+    u8x8.drawString(0,0,"  BUTTON");
+  }
+
+  // Upper right
+  if(digitalRead(buttonPin1) == 0){
+    u8x8.drawString(0,1,"X RIGHT");
+    chase(strip.Color(255, 0, 0));
+  }else{
+    u8x8.drawString(0,1,"  RIGHT");
+  }
+
+  // Upper left
+  if(digitalRead(buttonPin3) == 0){
+    u8x8.drawString(0,2,"X UP");
+    chase(strip.Color(0, 0, 255));
+  }else{
+    u8x8.drawString(0,2,"  UP");
+  }
+
+  // Lower right
+  if(digitalRead(buttonPin4) == 0){
+    u8x8.drawString(0,3,"X DOWN");
+    chase(strip.Color(255, 0, 255));
+  }else{
+    u8x8.drawString(0,3,"  DOWN");
+  }
+
+  // Lower left
+  if(digitalRead(buttonPin5) == 0){
+    u8x8.drawString(0,4,"X LEFT");
+    chase(strip.Color(255, 255, 255));
+  }else{
+    u8x8.drawString(0,4,"  LEFT");
+  }
+  //String touchData = String(buff(T9));
+  //Serial.println(touchData);
+  u8x8.setCursor(0, 5);
+  u8x8.print("  TOUCH " + String(buff(T9)));
+}
+
+static void chase(uint32_t c) {
+  for(uint16_t i=0; i<strip.numPixels()+4; i++) {
+      strip.setPixelColor(i  , c); // Draw new pixel
+      strip.setPixelColor(i-4, 0); // Erase pixel a few steps back
+      strip.show();
+      delay(25);
+  }
+}
+


detect water function

detect water function

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


Changed backlight setting

Changed backlight setting

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


Focussing on Rollups logic

Focussing on Rollups logic

include an interrupt to confirm the opening of the greenhouse.

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

--- Rollup_logic/Rollup_logic.ino
+++ Rollup_logic/Rollup_logic.ino
@@ -0,0 +1,252 @@
+#include <OneWire.h>
+#include <DallasTemperature.h>
+
+#define Open 1
+#define Close 0
+
+#define ONE_WIRE_BUS 2
+#define ROLLUP1_OPEN  12//relais on/off - moteur1
+#define ROLLUP1_CLOSE  11 //relais gauche/droite - moteur1
+#define FAN  8 //relais ventilation forcée
+#define CHAUFFAGE1 7 //relais fournaise1
+#define CHAUFFAGE2 6 // relais fournaise2
+
+OneWire oneWire(ONE_WIRE_BUS);
+// Pass our oneWire reference to Dallas Temperature.
+DallasTemperature sensors(&oneWire);
+
+const int ON = HIGH;
+const int OFF = LOW;
+
+byte opened = 100;
+byte openTarget = 0;
+
+boolean heating1 = false;                     //fournaise 1 éteinte par défaut
+boolean heating2 = false;                     //fournaise 2 éteinte par défaut
+boolean fan = false;                          //VENTilation forcée éteinte par défaut
+float greenhouseTemperature = 20.0;               //température par défaut : 20C (ajusté après un cycle)
+
+int TEMP_CIBLE = 20;          //température cible par défaut : 20C (ajustée après un cycle))
+//temp cible pour équipement chauffage/refroidissement
+int TEMP_ROLLUP1 = TEMP_CIBLE+1;
+int TEMP_ROLLUP2 = TEMP_CIBLE+2;
+int TEMP_ROLLUP3 = TEMP_CIBLE+3;
+int TEMP_ROLLUP4 = TEMP_CIBLE+4;
+int TEMP_VENTILATION = TEMP_CIBLE+5;
+int TEMP_FOURNAISE1 = TEMP_CIBLE-2;
+int TEMP_FOURNAISE2 = TEMP_CIBLE-4;
+
+byte HYST_ROLLUP = 2;           //hysteresis rollup
+byte HYST_VENT = 2;             //hysteresis ventilation
+byte HYST_FOURNAISE1 = 2;       //hysteresis fournaise 1
+byte HYST_FOURNAISE2 = 2;       //hysteresis fournaise 2
+
+long OPENING_TIME;       //temps de rotation des moteurs pour ouvrir d'un quart de tour(en mili-secondes)
+long CLOSING_TIME;       //temps de rotation des moteurs pour fermer d'un quart de tour(en mili-secondes)
+long PAUSE_TIME;         //temps d'arrêt entre chaque ouverture/fermeture(en mili-secondes)
+//incréments d'ouverture(nombre d'incréments d'ouverture = PCT_OPEN/NB_OF_STEPS_IN_ANIMATION = 25/5 = 5 incréments d'ouverture)
+const int PCT_OPEN = 25;
+const int NB_OF_STEPS_IN_ANIMATION = 5; //doit être un divisible de PCT_OPEN
+//Autres variables
+const int SLEEPTIME = 900; //temps de pause entre chaque exécution du programme(en mili-secondes)
+
+
+volatile byte rollupState = LOW;
+
+void setup() {
+  // put your setup code here, to run once:
+  Serial.begin(9600);
+  sensors.begin();
+
+  pinMode(ROLLUP1_OPEN, OUTPUT);
+  digitalWrite(ROLLUP1_OPEN, LOW);
+  pinMode(ROLLUP1_CLOSE, OUTPUT);
+  digitalWrite(ROLLUP1_CLOSE, LOW);
+  pinMode(CHAUFFAGE1, OUTPUT);
+  digitalWrite(CHAUFFAGE1, LOW);
+  pinMode(CHAUFFAGE2, OUTPUT);
+  digitalWrite(CHAUFFAGE2, LOW);
+  pinMode(FAN, OUTPUT);
+  digitalWrite(FAN, LOW);
+  attachInterrupt(digitalPinToInterrupt(2), confirmOpening, CHANGE);
+
+  //Remise à niveau des rollup
+  Reset();
+}
+
+void loop() {
+  // put your main code here, to run repeatedly:
+  //--------------DS18B20--------------------
+  sensors.requestTemperatures();
+  greenhouseTemperature = sensors.getTempCByIndex(0);
+  //--------------Relais--------------------
+
+  //Programme d'ouverture/fermeture des rollups à 4 paliers
+  if ((opened = 0)&&(greenhouseTemperature > TEMP_ROLLUP1)){
+    openTarget = 25;
+    openSides();
+  }
+  else if ((opened = 1)&&(greenhouseTemperature > TEMP_ROLLUP2)){
+    openTarget = 50;
+    openSides();
+  }
+  else if ((opened = 2)&&(greenhouseTemperature > TEMP_ROLLUP3)){
+    openTarget = 75;
+    openSides();
+  }
+  else if ((opened = 3)&&(greenhouseTemperature > TEMP_ROLLUP4)){
+    openTarget = 100;
+    openSides();
+  }
+  else if ((opened = 4)&&(greenhouseTemperature < (TEMP_ROLLUP4 - HYST_ROLLUP))) {
+    openTarget = 75;
+    closeSides();
+  }
+  else if ((opened = 3)&&(greenhouseTemperature < (TEMP_ROLLUP3 - HYST_ROLLUP))) {
+    openTarget = 50;
+    closeSides();
+  }
+  else if ((opened = 2)&&(greenhouseTemperature < (TEMP_ROLLUP2 - HYST_ROLLUP))) {
+    openTarget = 25;
+    closeSides();
+  }
+  else if ((opened = 1)&&(greenhouseTemperature < (TEMP_ROLLUP1 - HYST_ROLLUP))) {
+    openTarget = 0;
+    closeSides();
+  }
+
+  //Programme fournaise1
+  if (greenhouseTemperature < TEMP_FOURNAISE1) {
+    setHeater1(ON);
+  }
+  else if (greenhouseTemperature > (TEMP_FOURNAISE1 + HYST_FOURNAISE1)) {
+    setHeater1(OFF);
+  }
+  //Programme fournaise2
+  if (greenhouseTemperature < TEMP_FOURNAISE2) {
+    setHeater2(ON);
+  }
+  else if (greenhouseTemperature > (TEMP_FOURNAISE2 + HYST_FOURNAISE2)) {
+    setHeater2(OFF);
+  }
+  //Programme ventilation forcée
+  if ((greenhouseTemperature > TEMP_VENTILATION)&&(rollupState == HIGH)) {
+    setFan(ON);
+  } else if ((greenhouseTemperature < (TEMP_VENTILATION - HYST_VENT))||(rollupState == LOW)) {
+    setFan(OFF);
+  }
+}
+
+
+
+void Reset(){
+    Serial.println(F("Resetting position"));
+  for (int i = 0; i < 5; i++) {
+    closeSides();
+  }
+  Serial.println(F("Resetting done"));
+}
+
+//Affichage du % d'ouverture des rollup
+void setOpenedStatus(int pctIncrease) {
+  opened += pctIncrease;
+  if (opened < 0) {
+    opened = 0;
+  } else if (opened > 100) {
+    opened = 100;
+  }
+  Serial.print(F("    "));
+  Serial.println(opened);
+}
+
+//Exécution de la séquence d'ouverture/fermeture
+void animate(int movement, int action) {
+  for (int i = 0; i < NB_OF_STEPS_IN_ANIMATION; i++) {
+    if (action == Open){
+      delay(OPENING_TIME / NB_OF_STEPS_IN_ANIMATION);}
+    else if (action == Close){
+      delay(CLOSING_TIME / NB_OF_STEPS_IN_ANIMATION);}
+    setOpenedStatus(movement * PCT_OPEN / NB_OF_STEPS_IN_ANIMATION);
+  }
+}
+
+//Programme d'ouverture des rollup
+void openSides() {
+  if (opened < 100) {
+    Serial.println(F(""));
+    Serial.println(F("  Opening"));
+    digitalWrite(ROLLUP1_OPEN, ON);
+    //digitalWrite(ROLLUP2_OPEN, ON);
+    animate(1, Open);
+    digitalWrite(ROLLUP1_OPEN, OFF);
+    //digitalWrite(ROLLUP2_OPEN, OFF);
+    Serial.println(F("  Done opening"));
+    delay(PAUSE_TIME);
+  }
+}
+
+//Programme de fermeture des rollups
+void closeSides() {
+  if (opened > 0) {
+    Serial.println(F(""));
+    Serial.println(F("  Closing"));
+    //digitalWrite(ROLLUP2_CLOSE, ON);
+    animate(-1, Close);
+    digitalWrite(ROLLUP1_CLOSE, OFF);
+    //digitalWrite(ROLLUP2_CLOSE, OFF);
+    Serial.println(F("  Done closing"));
+    delay(PAUSE_TIME);
+  }
+}
+
+
+//État de la première fournaise
+void setHeater1(int heaterCommand1) {
+  if ((heaterCommand1 == ON) && (heating1 == false)) {
+    Serial.println(F(""));
+    Serial.println(F("  Start heating1"));
+    heating1 = true;
+    digitalWrite(CHAUFFAGE1, ON);
+  } else if ((heaterCommand1 == OFF) && (heating1 == true)) {
+    Serial.println(F(""));
+    Serial.println(F("  Stop heating1"));
+    heating1 = false;
+    digitalWrite(CHAUFFAGE1, OFF);
+  }
+}
+
+//État de la deuxième fournaise
+void setHeater2(int heaterCommand2) {
+  if ((heaterCommand2 == ON) && (heating2 == false)) {
+    Serial.println(F(""));
+    Serial.println(F("  Start heating2"));
+    heating2 = true;
+    digitalWrite(CHAUFFAGE2, ON);
+  } else if ((heaterCommand2 == OFF) && (heating2 == true)) {
+    Serial.println(F(""));
+    Serial.println(F("  Stop heating2"));
+    heating2 = false;
+    digitalWrite(CHAUFFAGE2, OFF);
+  }
+}
+
+//État de la ventilation
+void setFan(int fanCommand) {
+  if ((fanCommand == ON) && (fan == false)) {
+    Serial.println(F(""));
+    Serial.println(F("  Start fan"));
+    fan = true;
+    digitalWrite(FAN, ON);
+  } else if ((fanCommand == OFF) && (fan == true)) {
+    Serial.println(F(""));
+    Serial.println(F("  Stop fan"));
+    fan = false;
+    digitalWrite(FAN, OFF);
+  }
+}
+
+void confirmOpening() {
+  rollupState =! rollupState;
+}
+
+


Add RC car firmware

Add RC car firmware

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/embeddedemily/ember-agaricglow.git/'


relocated arduino code for impact & pulloff testing: MC wants separate tools for each test instead of a single program

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


update

update

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

--- arduino/penelope/penelope.ino
+++ arduino/penelope/penelope.ino
@@ -0,0 +1,187 @@
+/*
+Penélope
+Adriana Marmorek
+
+By: Andrés Luján y Karo Ladino
+*/
+
+#include <SPI.h>
+#include <Ethernet.h>
+#include <SoftwareSerial.h>
+#include <ArduinoJson.h>
+
+SoftwareSerial Thermal(5, 6);
+// Enter a MAC address for your controller below.
+// Newer Ethernet shields have a MAC address printed on a sticker on the shield
+byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
+// if you don't want to use DNS (and reduce your sketch size)
+// use the numeric IP instead of the name for the server:
+//IPAddress server(74,125,232,128);  // numeric IP for Google (no DNS)
+char server[] = "lovefrompenelope.herokuapp.com";    // name address for Google (using DNS)
+
+int heatTime = 80;
+int heatInterval = 255;
+char printDensity = 15;
+char printBreakTime = 15;
+//int 3,5,8
+int zero=0;
+boolean connected = false;
+
+// Set the static IP address to use if the DHCP fails to assign
+IPAddress ip(192, 168, 0, 177);
+
+// Initialize the Ethernet client library
+// with the IP address and port of the server
+// that you want to connect to (port 80 is default for HTTP):
+EthernetClient client;
+
+void setup() {
+  pinMode(3, OUTPUT); //Twitter
+    pinMode(9, OUTPUT); // Printing
+      pinMode(8, OUTPUT); //Shredder
+
+  // Open serial communications and wait for port to open:
+  Serial.begin(57600);
+  Thermal.begin(19200); // to write to our new printer
+  initInternet();
+  initPrinter();
+
+}
+
+void initInternet() {
+  // start the Ethernet connection:
+  if (Ethernet.begin(mac) == 0) {
+    Serial.println("Failed to configure Ethernet using DHCP");
+    // try to congifure using IP address instead of DHCP:
+    Ethernet.begin(mac, ip);
+  }
+  // give the Ethernet shield a second to initialize:
+  delay(1000);
+  Serial.println("connecting...");
+
+  // if you get a connection, report back via serial:
+  if (client.connect(server, 80)) {
+    Serial.println("connected");
+    connected = true;
+  } else {
+    // if you didn't get a connection to the server:
+    Serial.println("connection failed");
+    Thermal.println("I can't find you love");
+    connected = false;
+    Thermal.write(10);
+    Thermal.write(10);
+    Thermal.write(10);
+  }
+}
+
+void initPrinter()
+{
+ //Modify the print speed and heat
+ Thermal.write(27);
+ Thermal.write(55);
+ Thermal.write(7); //Default 64 dots = 8*('7'+1)
+ Thermal.write(heatTime); //Default 80 or 800us
+ Thermal.write(heatInterval); //Default 2 or 20us
+ //Modify the print density and timeout
+ Thermal.write(18);
+ Thermal.write(35);
+ int printSetting = (printDensity<<4) | printBreakTime;
+ Thermal.write(printSetting); //Combination of printDensity and printBreakTime
+ Serial.println("Printer ready");
+ Thermal.println("Where are you, love?");
+ Thermal.println("Adriana Marmorek");
+ Thermal.write(10);
+ Thermal.write(10);
+}
+
+void loop() {
+  // if there are incoming bytes available
+  // from the server, read them and print them:
+  // Make a HTTP request:
+
+  if (connected) {
+   digitalWrite(3, HIGH);
+   delay(1000);
+   digitalWrite(3, LOW);
+   delay(1000);
+   digitalWrite(3, HIGH);
+   delay(1000);
+   digitalWrite(3, LOW);
+
+    client.println("GET / HTTP/1.1");
+    client.println("Content-Type: application/json;charset=utf-8");
+    client.println("Host: lovefrompenelope.herokuapp.com");
+    client.println("Connection: keep-alive");
+    client.println();
+    String tweet = ""; ///-
+    boolean read = false; ///-
+    while (client.available()) {
+      char c = client.read();
+      if (c == '{') {
+        read = true;
+      }
+//    else if (c == '}') {
+//      read = false;
+//    }
+      if (read == true) {
+        tweet += c;
+      }
+    }
+// tweet += "}";
+  Serial.println(tweet);
+  Serial.println(tweet.length());
+    //char json[300];
+  //tweet.toCharArray(json, 300);
+  StaticJsonBuffer<400> jsonBuffer;
+  JsonObject& root = jsonBuffer.parseObject(tweet);
+  const char* name = root["name"];
+  const char* user = root["user"];
+  const char* text = root["text"];
+  const char* date = root["date"];
+
+  String header = "";
+  Serial.println(name);
+  Serial.println(user);
+  Serial.println(text);
+  Serial.println(date);
+
+
+   // Name and date
+   Thermal.println(name);
+   Thermal.write(27);
+   Thermal.write(45);
+   Thermal.write(1);
+   Thermal.println(date);
+
+   // User and text
+   Thermal.write(27);
+   Thermal.write(45);
+   Thermal.write(zero);
+   Thermal.println(user); //31 caracteres,
+   Thermal.println(text); //31 caracteres,
+   Thermal.write(10);
+   Thermal.write(10);
+   Thermal.write(10);
+   digitalWrite(9, HIGH);
+   delay(1000);
+   digitalWrite(9, LOW);
+
+//Shredder
+  delay(5000);
+   digitalWrite(8, HIGH);
+   delay(2000);
+   digitalWrite(8, LOW);
+//Waiting
+  delay(45000);
+
+    if (!client.connected()) {
+    Serial.println();
+    Serial.println("disconnecting.");
+    client.stop();
+    initInternet();
+   }
+  } else {
+    initInternet();
+  }
+
+}


+ clap detection

+ clap detection

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

--- attiny_ir_fan_remote_CLAP.ino
+++ attiny_ir_fan_remote_CLAP.ino
@@ -0,0 +1,152 @@
+//Anor Batista Esteves Neto
+//  08/01/2015
+//  Attiny send IR Remote Key with button or clap
+// clap detection based on example from Manoj Kunthu (http://imanoj-tech.blogspot.com.br/2013/02/arduino-clapper.html)
+
+#include <attiny85_IR.h>
+
+// defining pins
+#define buttonPin  4    // attiny physical pin 3, button with pull down resistor
+#define ledPin     0      // attiny physical pin 5 , normal led for visual feedback of when we are sending an ir command
+#define micPin    3   // Analog Pin 3 = attiny physical pin 2
+
+//defining constants
+#define TRIGGER 60 //point above average that is considered a clap
+#define CLAPS_TO_ACTIVATE 2 //The number of claps detected before output is toggled
+#define CLAP_TIME 4000 // Time between claps
+
+
+
+IRsend irsend; // IR led on physical pin 6 (D1) , the IR output will be always on attiny physical pin 6
+
+// Variables that will change:
+int buttonState = HIGH;             // the current reading from the input pin
+int lastButtonState = HIGH;   // the previous reading from the input pin
+// the following variables are long's because the time, measured in miliseconds,
+// will quickly overflow an int
+long lastDebounceTime = 0;  // the last time the output pin was toggled
+long debounceDelay = 50;    // the debounce time; increase if the output flickers
+
+//variable to store the value read from the mic
+int micValue = 0;
+
+//CLAP STATE CONSTANTS
+const int FINAL_DETECTED = 0, LOST_CONTINUITY = 1, CLAP_NOT_DETECTED = 2;
+
+int SIZE = 3;
+int buffer[3];
+int loopIteration = 0;
+int average = 0;
+int total = 0;
+
+
+void setup() {
+  pinMode(buttonPin, INPUT);
+  digitalWrite(buttonPin,HIGH); //activating internal pull-up on button pin
+  pinMode(ledPin,OUTPUT);
+  digitalWrite(ledPin,LOW);
+}
+
+void loop() {
+  check_button();
+  check_claps();
+ }
+
+//Check the button, if pressed send ir command.
+void check_button( void ){
+    // read the state of the switch into a local variable:
+    int reading = digitalRead(buttonPin);
+
+    // check to see if you just pressed the button
+    // (i.e. the input went from LOW to HIGH),  and you've waited
+    // long enough since the last press to ignore any noise:
+
+    // If the switch changed, due to noise or pressing:
+    if (reading != lastButtonState) {
+      // reset the debouncing timer
+      lastDebounceTime = millis();
+    }
+
+    if ((millis() - lastDebounceTime) > debounceDelay) {
+      // whatever the reading is at, it's been there for longer
+      // than the debounce delay, so take it as the actual current state:
+      // if the button state has changed:
+      if (reading != buttonState)  buttonState = reading;
+      if (buttonState == LOW) send_ir();
+    }
+    // save the reading.  Next time through the loop,
+    // it'll be the lastButtonState:
+    lastButtonState = reading;
+}
+
+// Send ir command to toggle the fan light
+void send_ir(){
+    irsend.sendNEC(150468615, 32); // ir code for my fan light
+    digitalWrite(ledPin,HIGH); // just a visual feedback
+    delay(200);
+    digitalWrite(ledPin,LOW);
+}
+
+//read the mic value and store it in a global variable
+void read_mic(void){
+  micValue = analogRead(micPin);
+}
+
+/**
+* Purpose:  A clap is detected when the sensor value is greater than the average plus
+*     an offset.  The offset might need to be fine tuned for different sound sensors.
+*/
+boolean clap_detected()
+{
+    return micValue > average + TRIGGER;
+}
+
+void check_claps(){
+    int clapState = detect_claps(CLAPS_TO_ACTIVATE);
+
+    if(clapState == FINAL_DETECTED)
+    {
+      // indicate_clap(1);//turn off any clap indicating lights
+       send_ir();
+    }
+    else if(clapState == LOST_CONTINUITY)
+    {
+      // indicate_clap(0);//turn off any clap indicating lights
+    }
+}
+
+int detect_claps(int numClaps)
+{
+  int clapNum = numClaps;
+
+  //Base Case - if clapNum is 0, then all claps have been accounted.
+  if(clapNum == 0)
+  {
+    return FINAL_DETECTED;
+  }
+
+  //Read from mic and update ambient noise levels.
+  read_mic();
+
+  total = (total - buffer[loopIteration]) + micValue;
+  average = (total/SIZE);
+  buffer[loopIteration] = micValue;
+
+  loopIteration = (loopIteration+1)%SIZE;
+
+  if(clap_detected())
+  {
+    delay(50);
+    for(int i = 0; i < CLAP_TIME; i++)
+    {
+      int clapState = detect_claps(clapNum - 1);
+
+      if(clapState == FINAL_DETECTED || clapState == LOST_CONTINUITY)
+      {
+         return clapState;
+      }
+    }
+    return LOST_CONTINUITY;
+  }
+  return CLAP_NOT_DETECTED;
+}


Removed old include from removed driver

Removed old include from removed driver

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


Reduce font size

Reduce font size

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


Fixes for lights

Fixes for lights

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/WestwoodRobotics/BEST-2015.git/'


Create AHRS_euler_ekf.ino

Create AHRS_euler_ekf.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/mcprakash/ardunav.git/'


Added demo code for arduino due board.

Added demo code for arduino due board.

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

--- ArduinoDue/sketch_demo.ino
+++ ArduinoDue/sketch_demo.ino
@@ -0,0 +1,33 @@
+#define C_LOGGER_ADDR  (0x400E1000)
+#define PY_LOGGER_ADDR (0x400E1200)
+#define RS_LOGGER_ADDR (0x400E1400)
+
+void setup()
+{
+  Serial.begin(9600);
+  Serial.println("start");
+}
+
+void say_hello_logger(int addr, const char * msg)
+{
+    int cnt = 0;
+    while (cnt < strlen(msg))
+    {
+        *(int*)addr = msg[cnt++];
+    }
+    *(int*)addr = '\n';
+}
+
+void loop()
+{
+  while (1)
+  {
+    Serial.println("-------------------LOOP START-------------------");
+
+    say_hello_logger(C_LOGGER_ADDR, "Hello C logger!");
+    say_hello_logger(PY_LOGGER_ADDR, "Hello PY logger!");
+    say_hello_logger(RS_LOGGER_ADDR, "Hello RUST logger!");
+
+    Serial.println("===================loop end===================");
+  }
+}


some minor tweaks

some minor tweaks

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


Add Super Nintendo Entertainment System (SNES) Controller/Gamepad to USB

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

--- SuperNintendoEntertainmentSystem_GamePad_USB/SuperNintendoEntertainmentSystem_GamePad_USB.ino
+++ SuperNintendoEntertainmentSystem_GamePad_USB/SuperNintendoEntertainmentSystem_GamePad_USB.ino
@@ -0,0 +1,108 @@
+/* Super Nintendo Entertainment System (SNES) Controller/Gamepad to USB
+ * Auth: John Milner / jfrmilner
+ *
+ * Version
+ * 1.0
+ *
+ * Date
+ * July 2016
+ *
+ * Hardware
+ * ATmega32u4 based Arduino (Arduino Leonardo/Micro)
+ * Super Nintendo Entertainment System Controller
+ *
+ * Software
+ * Arduino IDE 1.6.8
+ * Arduino Joystick Library 1.0.1 - https://github.com/MHeironimus/ArduinoJoystickLibrary
+ *
+ * Works with..
+ * OS (plug and play): Windows 10 / Linux RetroPie 3.8.1
+ * Snes9x (SNES Emulator) - http://www.snes9x.com/ / https://tcrf.net/SNES_Test_Program
+ *
+ * Pinout - http://pinoutsguide.com/Game/snescontroller_pinout.shtml
+ *
+ * 7 pin SNES proprietary female connector view:
+ *  -----------------\
+ * | 1 2 3 4 | 5 6 7 |
+ *  -----------------/
+ * pin 1: +5v
+ * pin 2: Data Clock
+ * pin 3: Data Latch
+ * pin 4: Serial Data
+ * pin 5: No Connection
+ * pin 6: No Connection
+ * pin 7: Ground
+ *
+ */
+
+#include <Joystick.h>
+
+// Controller Buttons
+#define SNES_B       1      //000000000001
+#define SNES_Y       2      //000000000010
+#define SNES_SELECT  4      //000000000100
+#define SNES_START   8      //000000001000
+#define SNES_UP      16     //000000010000
+#define SNES_DOWN    32     //000000100000
+#define SNES_LEFT    64     //000001000000
+#define SNES_RIGHT   128    //000010000000
+#define SNES_A       256    //000100000000
+#define SNES_X       512    //001000000000
+#define SNES_L       1024   //010000000000
+#define SNES_R       2048   //100000000000
+
+const int PIN_CLOCK = 6;
+const int PIN_LATCH = 7;
+const int PIN_DATA = 12;
+
+void setup(){
+  Joystick.begin(false);
+
+  pinMode(PIN_CLOCK, OUTPUT);
+  digitalWrite(PIN_CLOCK, HIGH);
+  pinMode(PIN_LATCH, OUTPUT);
+  digitalWrite(PIN_LATCH, LOW);
+  pinMode(PIN_DATA, INPUT_PULLUP);
+}
+
+void loop(){
+  uint16_t state = 0;
+    // 12us latch
+    digitalWrite(PIN_LATCH, HIGH);
+    delayMicroseconds(12);
+    digitalWrite(PIN_LATCH, LOW);
+    delayMicroseconds(6);
+    // Retrieve 4021s sixteen bits of data
+    for(int i = 0; i < 16; i++){
+        digitalWrite(PIN_CLOCK, LOW);
+        delayMicroseconds(6);
+        state |= digitalRead(PIN_DATA) << i;
+        digitalWrite(PIN_CLOCK, HIGH);
+        delayMicroseconds(6);
+    }
+
+  // buttons
+  SNES_B & ~state ? Joystick.pressButton(0) : Joystick.releaseButton(0);
+  SNES_Y & ~state ? Joystick.pressButton(1) : Joystick.releaseButton(1);
+  SNES_SELECT & ~state ? Joystick.pressButton(2) : Joystick.releaseButton(2);
+  SNES_START & ~state ? Joystick.pressButton(3) : Joystick.releaseButton(3);
+  SNES_A & ~state ? Joystick.pressButton(4) : Joystick.releaseButton(4);
+  SNES_X & ~state ? Joystick.pressButton(5) : Joystick.releaseButton(5);
+  SNES_L & ~state ? Joystick.pressButton(6) : Joystick.releaseButton(6);
+  SNES_R & ~state ? Joystick.pressButton(7) : Joystick.releaseButton(7);
+
+  // 360° Hat Switch 0
+  Joystick.setHatSwitch(0, -1); // release
+  if (SNES_UP & ~state) Joystick.setHatSwitch(0, 0);
+  if (SNES_RIGHT & ~state) Joystick.setHatSwitch(0, 90);
+  if (SNES_DOWN & ~state) Joystick.setHatSwitch(0, 180);
+  if (SNES_LEFT & ~state) Joystick.setHatSwitch(0, 270);
+  if (SNES_UP & ~state && SNES_RIGHT & ~state) Joystick.setHatSwitch(0, 45);
+  if (SNES_DOWN & ~state && SNES_RIGHT & ~state) Joystick.setHatSwitch(0, 135);
+  if (SNES_DOWN & ~state && SNES_LEFT & ~state) Joystick.setHatSwitch(0, 225);
+  if (SNES_UP & ~state && SNES_LEFT & ~state) Joystick.setHatSwitch(0, 315);
+
+  Joystick.sendState();
+  delay(25);
+}
+


Added files via upload

Added files via upload

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

--- hvacMonitor.ino
+++ hvacMonitor.ino
@@ -0,0 +1,207 @@
+/*
+    v4: Stable! Basic blower motor ON/OFF and status in minutes only.
+    v5: Holy shit I think I've done it and graceful to boot! NEED TO TEST THIS!!!
+    v6: Call Guinness! It works!
+    v7: Added date and fixed for single/double digit time and date.
+    v8: Add additional DS18B20 at house t-stat (CAT5e or extra tstat wire). Add logic for notification/alarm if split temp is too low after X minutes.
+        Might still want to use an acutal RTC to avoid some of the Blynk BS and timezone changes.
+        Sounds like Blynk made a change allowing for RTC time zone. Not sure if that's through the app or the code.
+        Learn to use arrays with strings to clean up the lcd.print madness!
+*/
+
+#include <SimpleTimer.h>
+#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
+#include <ESP8266WiFi.h>
+#include <BlynkSimpleEsp8266.h>
+#include <OneWire.h>
+#include <DallasTemperature.h>
+#include <TimeLib.h>
+#include <WidgetRTC.h>
+#define ONE_WIRE_BUS 2
+
+OneWire oneWire(ONE_WIRE_BUS);
+DallasTemperature sensors(&oneWire);
+
+DeviceAddress ds18b2001 = { 0x28, 0x77, 0x8A, 0x1E, 0x00, 0x00, 0x80, 0xD4 }; // Temp test probe
+DeviceAddress ds18b20RA = { 0x28, 0xEF, 0x97, 0x1E, 0x00, 0x00, 0x80, 0x54 }; // Return air probe
+DeviceAddress ds18b20SA = { 0x28, 0xF1, 0xAC, 0x1E, 0x00, 0x00, 0x80, 0xE8 }; // Supply air probe
+
+char auth[] = "getFromBlynkApp";
+
+SimpleTimer timer;
+
+WidgetLCD lcd(V5);
+
+WidgetRTC rtc;
+BLYNK_ATTACH_WIDGET(rtc, V8);
+
+int blowerPin = 0;  // Pin connected to 3.3V fed from blower motor.
+int offHour, offHour24, onHour, onHour24, offMinute, onMinute, offSecond, onSecond, offMonth, onMonth, offDay, onDay;
+
+void setup()
+{
+  Serial.begin(9600);
+  Blynk.begin(auth, "ssid1", "pw1");
+  //Blynk.begin(auth, "ssid2", "pw2");
+
+  //WiFi.softAP("ssid", "pw");
+  //WiFi.softAPdisconnect(true);
+
+  sensors.begin();
+  // Add more of below as more sensors are added. 9, 10, 11, or 12 bits, corresponding to increments of 0.5°C, 0.25°C, 0.125°C, and 0.0625°C, respectively.
+  // Defaults to 12-bit if not set. ~94ms conversion time for 9-bit, to 750ms for 12-bit!
+  sensors.setResolution(ds18b20RA, 10);
+  sensors.setResolution(ds18b20SA, 10);
+  sensors.setResolution(ds18b2001, 10);
+
+  timer.setInterval(1000L, sendTemps); // Temperature sensor polling interval
+  timer.setInterval(10000L, sendStatus); // Blower fan status polling interval
+
+
+  while (Blynk.connect() == false) {
+    // Wait until connected
+  }
+
+  // Begin synchronizing time
+  rtc.begin();
+
+  // Display digital clock every 10 seconds
+  timer.setInterval(10000L, clockDisplay);
+
+}
+
+void clockDisplay()
+{
+  // You can call hour(), minute(), ... at any time
+  // Please see Time library examples for details
+  BLYNK_LOG("Current time: %02d:%02d:%02d %02d %02d %d",
+            hour(), minute(), second(),
+            day(), month(), year());
+}
+
+void sendTemps()
+{
+  sensors.requestTemperatures(); // Polls the sensors
+  float tempRA = sensors.getTempF(ds18b20RA);
+  float tempSA = sensors.getTempF(ds18b20SA);
+  float tempTEST = sensors.getTempF(ds18b2001);
+
+  Blynk.virtualWrite(0, tempRA);
+  Blynk.virtualWrite(1, tempSA);
+  Blynk.virtualWrite(2, tempTEST);
+}
+
+void sendStatus()
+{
+  if (digitalRead(blowerPin) == HIGH)
+  {
+    lcd.clear();
+    lcd.print(0, 0, " HVAC OFF since");
+    if (offHour < 10)
+    {
+      lcd.print(1, 1, offHour);
+    }
+    else
+    {
+      lcd.print(0, 1, offHour);
+    }
+
+    lcd.print(2, 1, ":");
+
+    if (offMinute < 10)
+    {
+      lcd.print(3, 1, "0");
+      lcd.print(4, 1, offMinute);
+    }
+    else
+      lcd.print(3, 1, offMinute);
+
+    if (offHour24 < 12)
+    {
+      lcd.print(5, 1, "AM on");
+    }
+    else
+    {
+      lcd.print(5, 1, "PM on");
+    }
+    if (offMonth < 10)
+    {
+      lcd.print(11, 1, offMonth);
+      lcd.print(12, 1, "/");
+      lcd.print(13, 1, offDay);
+    }
+    else
+    {
+      lcd.print(11, 1, offMonth);
+      lcd.print(13, 1, "/");
+      lcd.print(14, 1, offDay);
+    }
+
+    onHour24 = hour();
+    onHour = hourFormat12();
+    onMinute = minute();
+    onSecond = second();
+    onMonth = month();
+    onDay = day();
+  }
+  else
+  {
+    //Start code for ON state
+    lcd.clear();
+    lcd.print(0, 0, " HVAC ON since");
+    if (onHour < 10)
+    {
+      lcd.print(1, 1, onHour);
+    }
+    else
+    {
+      lcd.print(0, 1, onHour);
+    }
+
+    lcd.print(2, 1, ":");
+
+    if (offMinute < 10)
+    {
+      lcd.print(3, 1, "0");
+      lcd.print(4, 1, onMinute);
+    }
+    else
+      lcd.print(3, 1, onMinute);
+
+    if (onHour24 < 12)
+    {
+      lcd.print(5, 1, "AM on");
+    }
+    else
+    {
+      lcd.print(5, 1, "PM on");
+    }
+
+    if (onMonth < 10)
+    {
+      lcd.print(11, 1, onMonth);
+      lcd.print(12, 1, "/");
+      lcd.print(13, 1, onDay);
+    }
+    else
+    {
+      lcd.print(11, 1, onMonth);
+      lcd.print(13, 1, "/");
+      lcd.print(14, 1, onDay);
+    }
+
+    offHour24 = hour();
+    offHour = hourFormat12();
+    offMinute = minute();
+    offSecond = second();
+    offMonth = month();
+    offDay = day();
+  }
+}
+
+void loop()
+{
+  Blynk.run();
+  timer.run(); //Initiates SimpleTimer
+}
+


Battery Voltage readout

Battery Voltage readout

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


Test feather wifi.

Test feather wifi.

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

--- arduino/feather/wifi_test/wifi_test.ino
+++ arduino/feather/wifi_test/wifi_test.ino
@@ -0,0 +1,72 @@
+/*
+ *  Simple HTTP get webclient test
+ */
+
+#include <ESP8266WiFi.h>
+
+const char* ssid     = "";
+const char* password = "";
+
+const char* host = "wifitest.adafruit.com";
+
+void setup() {
+  Serial.begin(115200);
+  delay(100);
+
+  // We start by connecting to a WiFi network
+
+  Serial.println();
+  Serial.println();
+  Serial.print("Connecting to ");
+  Serial.println(ssid);
+
+  WiFi.begin(ssid, password);
+
+  while (WiFi.status() != WL_CONNECTED) {
+    delay(500);
+    Serial.print(".");
+  }
+
+  Serial.println("");
+  Serial.println("WiFi connected");
+  Serial.println("IP address: ");
+  Serial.println(WiFi.localIP());
+}
+
+int value = 0;
+
+void loop() {
+  delay(10000);
+  ++value;
+
+  Serial.print("connecting to ");
+  Serial.println(host);
+
+  // Use WiFiClient class to create TCP connections
+  WiFiClient client;
+  const int httpPort = 80;
+  if (!client.connect(host, httpPort)) {
+    Serial.println("connection failed");
+    return;
+  }
+
+  // We now create a URI for the request
+  String url = "/testwifi/index.html";
+  Serial.print("Requesting URL: ");
+  Serial.println(url);
+
+  // This will send the request to the server
+  client.print(String("GET ") + url + " HTTP/1.1\r\n" +
+               "Host: " + host + "\r\n" +
+               "Connection: close\r\n\r\n");
+  delay(500);
+
+  // Read all the lines of the reply from server and print them to Serial
+  while(client.available()){
+    String line = client.readStringUntil('\r');
+    Serial.print(line);
+  }
+
+  Serial.println();
+  Serial.println("closing connection");
+}


added ColorDuino code

added ColorDuino code

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

--- colorduino/colorduino_serial.ino
+++ colorduino/colorduino_serial.ino
@@ -0,0 +1,92 @@
+
+// Include required libraries
+#include <Adafruit_GFX.h>
+#include <Colorduino_GFX.h>
+
+// Create new Colorduino instance
+ColorduinoPanel Colorduino;
+
+// some vars required for timing
+long previousMillis = 0;
+long interval = 250;
+
+unsigned char bitmap[9];
+unsigned char serialBuffer[256];
+
+boolean hasMessage = false;
+long bufferIndex = 0;
+
+void drawBitmap(int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h, uint16_t color) {
+
+  int16_t i, j, byteWidth = (w + 7) / 8;
+
+  for(j=0; j<h; j++) {
+    for(i=0; i<w; i++ ) {
+      if(((bitmap[j * byteWidth + i / 8])) & (128 >> (i & 7))) {
+	Colorduino.drawPixel(x+i, y+j, color);
+      }
+    }
+  }
+}
+
+void draw() {
+  // clear the back-buffer
+  GFX_Color_t background = Colorduino.color(0, 0, 0);
+  Colorduino.fillColor(background);
+
+  // create new color
+  GFX_Color_t color = Colorduino.color(255, 0, 0);
+
+  // draw on the back-buffer
+  //Colorduino.drawLine(random(7), random(7), random(7), random(7), color);
+  //Colorduino.drawTriangle(0,0, 7,0 , 7,7, color);
+  drawBitmap(0,0, bitmap, 8,8, color),
+
+  // swap the buffers, but don't copy the new front-buffer to the new back-buffer
+  Colorduino.swapBuffers(false);
+}
+
+void setup() {
+  Serial.begin(19200);
+  Serial.println("*** ColorDuino ***");
+  Serial.println("starting...");
+
+
+  // Set port mode, load data structures and start the timer
+  Colorduino.init();
+  // Set white balance
+  Colorduino.setWhiteBalance(36, 63, 63);
+
+  Serial.println("ready.");
+}
+
+void loop() {
+
+  if (hasMessage) {
+    draw();
+    hasMessage = false;
+  }
+}
+
+unsigned char opcode = 0;
+void serialEvent() {
+  while (Serial.available()) {
+
+    unsigned char incomingByte = (char)Serial.read();
+
+    if (bufferIndex == 0) {
+      opcode = incomingByte;
+      bufferIndex++;
+    }
+    else if (bufferIndex == 8) {
+      bitmap[bufferIndex-1] = incomingByte;
+      hasMessage = true;
+      bufferIndex = 0;
+    }
+    else {
+      bitmap[bufferIndex-1] = incomingByte;
+      bufferIndex++;
+    }
+  }
+}
+


add radioBlip2 w/ VCC reporting

add radioBlip2 w/ VCC reporting

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

--- examples/RF12/radioBlip2/radioBlip2.ino
+++ examples/RF12/radioBlip2/radioBlip2.ino
@@ -0,0 +1,68 @@
+// Send out a radio packet every minute, consuming as little power as possible
+// 2012-05-09 <jc@wippler.nl> http://opensource.org/licenses/mit-license.php
+
+#include <JeeLib.h>
+#include <avr/sleep.h>
+
+#define BLIP_ID 1  // set this to a unique ID to disambiguate multiple nodes
+
+struct {
+  long ping;  // 32-bit counter
+  byte id;    // identity, should be different for each node
+  byte vcc;   // measured BCC, 1.0V = 0 .. 6.0V = 250
+} payload;
+
+volatile bool adcDone;
+
+// this must be added since we're using the watchdog for low-power waiting
+ISR(WDT_vect) { Sleepy::watchdogEvent(); }
+
+// for low-noise/-power ADC readouts, we'll use interrupts
+ISR(ADC_vect) { adcDone = true; }
+
+static byte vccRead (byte count =4) {
+  set_sleep_mode(SLEEP_MODE_ADC);
+  ADMUX = bit(REFS0) | 14; // use VCC and internal bandgap
+  bitSet(ADCSRA, ADIE);
+  while (count-- > 0) {
+    adcDone = false;
+    while (!adcDone)
+      sleep_mode();
+  }
+  bitClear(ADCSRA, ADIE);
+  // convert ADC readings to fit in one byte, i.e. 20 mV steps:
+  //  1.0V = 0, 1.8V = 40, 3.3V = 115, 5.0V = 200, 6.0V = 250
+  return (55U * 1023U) / (ADC + 1) - 50;
+}
+
+void setup() {
+    cli();
+    CLKPR = bit(CLKPCE);
+#if defined(__AVR_ATtiny84__)
+    CLKPR = 0; // div 1, i.e. speed up to 8 MHz
+#else
+    CLKPR = 1; // div 2, i.e. slow down to 8 MHz
+#endif
+    sei();
+    rf12_initialize(17, RF12_868MHZ, 5);
+    // see http://tools.jeelabs.org/rfm12b
+    rf12_control(0xC040); // set low-battery level to 2.2V i.s.o. 3.1V
+    payload.id = BLIP_ID;
+}
+
+void loop() {
+    ++payload.ping;
+    payload.vcc = vccRead();
+
+    while (!rf12_canSend())
+        rf12_recvDone();
+
+    rf12_sendStart(0, &payload, sizeof payload);
+    // set the sync mode to 2 if the fuses are still the Arduino default
+    // mode 3 (full powerdown) can only be used with 258 CK startup fuses
+    rf12_sendWait(2);
+
+    rf12_sleep(RF12_SLEEP);
+    Sleepy::loseSomeTime(60000);
+    rf12_sleep(RF12_WAKEUP);
+}


Add test sketch for moisture sensor and sd card on kit

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

--- ARTF_Sensors/examples/LowPowerMoistureWithSD/LowPowerMoistureWithSD.ino
+++ ARTF_Sensors/examples/LowPowerMoistureWithSD/LowPowerMoistureWithSD.ino
@@ -0,0 +1,92 @@
+/*
+  Test Moisture sensor readings on sensor platform
+
+  This sketch is designed to test the accuracy of the Moisture
+  sensor with the battery pack and circuit of the sensor platform.
+
+  This sketch takes 5 readings and averages them to
+  help verify similar calculations used in MoistureSensorGSM
+  sketch. The results are written to the SD card
+
+  Created 10 7 2014
+  Modified 10 7 2014
+*/
+#include <LowPower.h>
+
+#include <ARTF_SDCard.h>
+
+// ARTF SDCard Dependency
+#include <SdFat.h>
+#include <String.h>
+
+
+// Moisture sensor settings
+const byte MOISTURE_PIN = A6;
+const byte MOSFET_MS_PIN = 5;
+const int NUM_READINGS = 5;
+const int MOISTURE_MAX_READING = 600;
+
+
+// SD Card Settings
+const byte SD_CS_PIN = 10;
+#define OUTPUT_FILENAME "ultra.txt"
+
+
+ARTF_SDCard sd(SD_CS_PIN);
+
+void setup()
+{
+  Serial.begin(9600);
+  pinMode(SD_CS_PIN, OUTPUT);
+}
+
+int count = 1;
+void loop()
+{
+
+  LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
+
+  String output = "";
+
+  output += "Trial " + String(count) + "\n";
+  output += "-------------------\n";
+
+
+  digitalWrite(MOSFET_MS_PIN, HIGH);
+  delay(3000);
+
+  // Take X readings
+  int moistureReadings[NUM_READINGS];
+  for (int i = 0; i < NUM_READINGS; ++i)
+  {
+    int reading = analogRead(MOISTURE_PIN);
+    moistureReadings[i] = (double)reading / (double)MOISTURE_MAX_READING;
+
+    output += String(i) + ". Analog:" + String(reading) + "; Calculated:" + String(moistureReadings[i]) + "\n";
+
+    delay(300);
+  }
+
+  digitalWrite(MOSFET_MS_PIN, LOW);
+  delay(500);
+
+
+  // Average the readings
+  double sumMoisture = 0.0;
+  for (int i = 0; i < NUM_READINGS; ++i)
+  {
+    sumMoisture += moistureReadings[i];
+  }
+  double avgMoisture = sumMoisture / NUM_READINGS;
+
+  // Rounded measurements
+  int roundedMoisture = round(avgMoisture * 100);
+
+  output += "Rounded:" + String(roundedMoisture) + "\n\n";
+
+  sd.begin();
+  sd.writeFile(OUTPUT_FILENAME, output);
+
+  delay(500);
+  count += 1;
+}


pretty printing

pretty printing


Fix vertical lines of gate time and slew rate boxes.

--- examples/seq/seq.ino
+++ examples/seq/seq.ino
@@ -238,13 +238,13 @@
     Display.draw_vline(widget_slew_->x() + 1, widget_slew_->y() + 1, 7, DUINO_SH1106::White);
     Display.draw_hline(widget_slew_->x() + 2, widget_slew_->y() + 1, 16, DUINO_SH1106::White);
     Display.draw_hline(widget_slew_->x() + 2, widget_slew_->y() + 7, 16, DUINO_SH1106::White);
-    Display.draw_vline(widget_slew_->x() + widget_slew_->width() - 1, widget_slew_->y() + 1, 7, DUINO_SH1106::White);
+    Display.draw_vline(widget_slew_->x() + widget_slew_->width() - 2, widget_slew_->y() + 1, 7, DUINO_SH1106::White);
     display_slew_rate(widget_slew_->x() + 2, widget_slew_->y() + 2, params.vals.slew_rate, DUINO_SH1106::White);

     Display.draw_vline(widget_gate_->x() + 1, widget_gate_->y() + 1, 7, DUINO_SH1106::White);
     Display.draw_hline(widget_gate_->x() + 2, widget_gate_->y() + 1, 16, DUINO_SH1106::White);
     Display.draw_hline(widget_gate_->x() + 2, widget_gate_->y() + 7, 16, DUINO_SH1106::White);
-    Display.draw_vline(widget_gate_->x() + widget_gate_->width() - 1, widget_slew_->y() + 1, 7, DUINO_SH1106::White);
+    Display.draw_vline(widget_gate_->x() + widget_gate_->width() - 2, widget_slew_->y() + 1, 7, DUINO_SH1106::White);
     display_gate_time(widget_gate_->x() + 2, widget_gate_->y() + 2, params.vals.gate_time, DUINO_SH1106::White);

     display_clock(widget_clock_->x() + 1, widget_clock_->y() + 1, params.vals.clock_bpm, DUINO_SH1106::White);


connect working, overflowing some damn wifi print buffer

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

--- examples/skynetim_wifi_echo/skynetim_wifi_echo.ino
+++ examples/skynetim_wifi_echo/skynetim_wifi_echo.ino
@@ -0,0 +1,168 @@
+/*
+ *                SSSSS  kk                            tt
+ *               SS      kk  kk yy   yy nn nnn    eee  tt
+ *                SSSSS  kkkkk  yy   yy nnn  nn ee   e tttt
+ *                    SS kk kk   yyyyyy nn   nn eeeee  tt
+ *                SSSSS  kk  kk      yy nn   nn  eeeee  tttt
+ *                               yyyyy
+ *
+ * SkynetClient for http://skynet.im, OPEN COMMUNICATIONS NETWORK & API FOR
+ * THE INTERNET OF THINGS.
+ *
+ * This sketch is VERY low on ram. Currently it only works on an Arduino Mega
+ * (4x the ram of an Uno)
+ *
+ * Works with ethernet shields compatible with EthernetClient library from
+ * Arduino. If you don't know, grab the original
+ * http://arduino.cc/en/Main/ArduinoEthernetShield
+ *
+ * Requires the ajson library https://github.com/interactive-matter/aJson
+ *
+ * You will notice we're using F() in Serial.print which might be new to you
+ * Its covered briefly on the arduino print page but it means we can store
+ * our strings in flash, instead of in ram.
+ *
+ * You can turn on debugging within SkynetClient.h by uncommenting
+ * #define SKYNETCLIENT_DEBUG
+ */
+
+#include <EEPROM.h>
+#include <aJSON.h>
+#include <WiFi.h>
+#include "SPI.h"
+#include "SkynetClient.h"
+
+SkynetClient skynetclient;
+
+char ssid[] = "Filthy Worm Babies";     //  your network SSID (name)
+char pass[] = "mart88@Qatar";  // your network password
+int status = WL_IDLE_STATUS;     // the Wifi radio's status
+
+char hostname[] = "skynet.im";
+int port = 80;
+
+void setup()
+{
+  //delay to give you time to open a console so we don't hammer server
+  delay(5000);
+  Serial.begin(9600);
+
+  // check for the presence of the shield:
+  if (WiFi.status() == WL_NO_SHIELD) {
+    Serial.println("WiFi shield not present");
+    // don't continue:
+    while (true);
+  }
+
+  String fv = WiFi.firmwareVersion();
+  if ( fv != "1.1.0" )
+    Serial.println("Please upgrade the firmware");
+
+  // attempt to connect to Wifi network:
+  while ( status != WL_CONNECTED) {
+    Serial.print("Attempting to connect to WPA SSID: ");
+    Serial.println(ssid);
+    // Connect to WPA/WPA2 network:
+    status = WiFi.begin(ssid, pass);
+
+    // wait 10 seconds for connection:
+    delay(10000);
+  }
+
+  // you're connected now, so print out the data:
+  Serial.print("You're connected to the network");
+  printCurrentNet();
+  printWifiData();
+
+  skynetclient.setMessageDelegate(onMessage);
+
+  bool status;
+  do {
+    status=skynetclient.connect(hostname, port);
+  }while(!status);
+
+  Serial.println(F("Connected!"));
+  Serial.print("uuid: ");
+  Serial.println(skynetclient.uuid);
+  Serial.print("token: ");
+  Serial.println(skynetclient.token);
+}
+
+aJsonObject *msg;
+
+void onMessage(aJsonObject *data){
+  //parse or print your message
+  Serial.println(aJson.print(data));
+
+  msg = aJson.getObjectItem(data, FROMUUID);
+
+  //Lets echo back if there was a fromuuid
+  if (strcmp(msg->name, FROMUUID) == 0){
+    Serial.print(F("return address:"));
+    Serial.println(msg->valuestring);
+    skynetclient.sendMessage(msg->valuestring, "Thanks!");
+  }
+}
+
+void loop(){
+  //need to call monitor to check for new data
+  skynetclient.monitor();
+}
+
+void printWifiData() {
+  // print your WiFi shield's IP address:
+  IPAddress ip = WiFi.localIP();
+  Serial.print("IP Address: ");
+  Serial.println(ip);
+  Serial.println(ip);
+
+  // print your MAC address:
+  byte mac[6];
+  WiFi.macAddress(mac);
+  Serial.print("MAC address: ");
+  Serial.print(mac[5], HEX);
+  Serial.print(":");
+  Serial.print(mac[4], HEX);
+  Serial.print(":");
+  Serial.print(mac[3], HEX);
+  Serial.print(":");
+  Serial.print(mac[2], HEX);
+  Serial.print(":");
+  Serial.print(mac[1], HEX);
+  Serial.print(":");
+  Serial.println(mac[0], HEX);
+
+}
+
+void printCurrentNet() {
+  // print the SSID of the network you're attached to:
+  Serial.print("SSID: ");
+  Serial.println(WiFi.SSID());
+
+  // print the MAC address of the router you're attached to:
+  byte bssid[6];
+  WiFi.BSSID(bssid);
+  Serial.print("BSSID: ");
+  Serial.print(bssid[5], HEX);
+  Serial.print(":");
+  Serial.print(bssid[4], HEX);
+  Serial.print(":");
+  Serial.print(bssid[3], HEX);
+  Serial.print(":");
+  Serial.print(bssid[2], HEX);
+  Serial.print(":");
+  Serial.print(bssid[1], HEX);
+  Serial.print(":");
+  Serial.println(bssid[0], HEX);
+
+  // print the received signal strength:
+  long rssi = WiFi.RSSI();
+  Serial.print("signal strength (RSSI):");
+  Serial.println(rssi);
+
+  // print the encryption type:
+  byte encryption = WiFi.encryptionType();
+  Serial.print("Encryption Type:");
+  Serial.println(encryption, HEX);
+  Serial.println();
+}


Modo viaje y modo alarma basicos para alarm-basics estructurado es funcional

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


Create solpev-alarm.ino

Create solpev-alarm.ino

Signed-off-by: Gianpaolo Macario <f8885408b8c3d931b330bae3c3a28a3af912c463@gmail.com>

error: pathspec 'Sketches/solpev-alarm/solpev-alarm.ino' did not match any file(s) known to git

--- Sketches/solpev-alarm/solpev-alarm.ino
+++ Sketches/solpev-alarm/solpev-alarm.ino
@@ -0,0 +1,52 @@
+/*
+ Input Pullup Serial
+
+ This example demonstrates the use of pinMode(INPUT_PULLUP). It reads a
+ digital input on pin 2 and prints the results to the serial monitor.
+
+ The circuit:
+ * Momentary switch attached from pin A1 to ground
+ * Built-in LED on pin 13
+
+ Unlike pinMode(INPUT), there is no pull-down resistor necessary. An internal
+ 20K-ohm resistor is pulled to 5V. This configuration causes the input to
+ read HIGH when the switch is open, and LOW when it is closed.
+
+ created 14 March 2012
+ by Scott Fitzgerald
+
+ http://www.arduino.cc/en/Tutorial/InputPullupSerial
+
+ This example code is in the public domain
+
+ Modified by Gianpaolo Macario, 2017-03-03
+
+ */
+
+void setup() {
+  //start serial connection
+  Serial.begin(9600);
+  //configure Analog Pin 1 of the Yun as a digital input and enable the internal pull-up resistor
+  pinMode(A1, INPUT_PULLUP);
+  pinMode(13, OUTPUT);
+
+}
+
+void loop() {
+  //read the pushbutton value into a variable
+  int sensorVal = digitalRead(A1);
+  //print out the value of the pushbutton
+  Serial.println(sensorVal);
+
+  // Keep in mind the pullup means the pushbutton's
+  // logic is inverted. It goes HIGH when it's open,
+  // and LOW when it's pressed. Turn on pin 13 when the
+  // button's pressed, and off when it's not:
+  if (sensorVal == HIGH) {
+    digitalWrite(13, LOW);
+  } else {
+    digitalWrite(13, HIGH);
+  }
+}
+
+// EOF