oops we should configure the motor drivers to the end …

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


Create Arduino_OS_WeatherV26.ino

Create Arduino_OS_WeatherV26.ino

Arduino Uno (with a 433Mhz Rx) outputs a CSV file with data intercepted from an OS WMR86 Weather Station (Anemometer, Wind Direction, Temperature, Rainfall) plus on board digital Barometer and Humidity sensors

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

--- Arduino_OS_WeatherV26.ino
+++ Arduino_OS_WeatherV26.ino
@@ -0,0 +1,525 @@
+/*Status:  Yet another Oregon Scientific Weather Station 433Mhz Arduino Signal Intercepter
+ *MIT Licence
+ *Author: Rob Ward April 2014
+ *Program Execution Summary-
+ *Finds the header bits and synch's to the waveform's 1->0 going edges, which are '1's
+ *Sweet spot for timing in this program is 240uS short pulse, 480uS long pulse, or thereabouts???
+ *Soaks up rest of header bits and waits for first 0
+ *Accumulates incoming data stream into bytes, arranged from MSB to LSB by rotating a mask in a Left Rotate
+ *Checks for Sensor ID's, the ID's used here are relative to the previous way the data is collected, so not the same as other authors
+ *Using the rotate bit on the fly the two ID bytes are as follows, this program just uses first byte to ID the sensor
+ *        Oregon-THGN800   0xAF  	Outside Temp-Hygro    AF 82 ?? 4 ?? 1 (Sensor nybble 1,2or3)  10byte packet (9bytes used)
+ *        Oregon-PCR800    0xA2 	Rain Gauge            A2 91 ?? 4 ?? 0                         11byte packet (11bytes used)
+ *        Oregon-WGR800    0xA1 	Anemometer            A1 98 ?? 4 ?? 0                         10byte packet (10bytes used)
+ *Rolling code 7bits is present to differentiate between alternative sensors, high bit set to 1 for 64 cycles means sensor is new.
+ NB Rolling code ignored to ID the sensor as there are no other Oregon Scientifics around me and this avoids problems on sensor resets
+ *Calculate the 8bit check sum of nybbles for the sensor and if data passes the test...continue  (2nybbles)
+ *Decode the nybbles (if bites are bytes, nybbles are nybbles :-) and calculate the parameters for each sensor
+ *On start up wait for a valid reading from each sensor and dump the calculations to the serial, round off to decimal places, every minute.
+
+ Why not use interrrupts and count durations?  Manchester encoding came from the time of slow chips, noisey environments and saggy waveforms.
+ The beauty of Manchester encoding is that it can be sampled so the 0V logic transitions are the most important and at least the logic
+ state in the middle of the timing periods is most likely to be valid.  It also self synchronises throughout the packet and
+ automatically detects timeouts.  This is an old, classic Manchester decoding decoding strategy, but quite robust never the less.
+ Plus the Uno is only doing this task so no problem with it being in the foreground and chewing up most of the CPU cycles there.
+
+ To do:
+ *find the battery indicators if they exist. (7) suggests it is (my) upper 4 bits of byte[3].  How to fake old batteries??
+ I put a 100ohm resistor across the terminals of the anemometer (in the springs) and chose some ordinary but OK batteries.
+ I clipped it up and ran it for about 3 days.  After the first 24hr anemometer started to get get shaky and dropping readings
+ However the byte[3]==4 all the time and did not change one bit.  I could not spot what bits if any were changing.
+ I did the experiment at my son's house away from my system or it would have corrupted the "official anemometer" readings.
+ A volt meter showed the voltage was dropping as expected but no clue discovered....
+
+ Reference Material:
+ Thanks to these authors, they all helped in some way, especially the last one Brian!!!!
+ http://wmrx00.sourceforge.net/Arduino/OregonScientific-RF-Protocols.pdf (1)
+ http://jeelabs.net/projects/cafe/wiki/Decoding_the_Oregon_Scientific_V2_protocol (2)
+ https://github.com/phardy/WeatherStation (3)
+ http://lucsmall.com/2012/04/27/weather-station-hacking-part-1/ (4)
+ http://lucsmall.com/2012/04/29/weather-station-hacking-part-2/ (5)
+ http://lucsmall.com/2012/04/29/weather-station-hacking-part-2/ (6)
+ http://www.mattlary.com/2012/06/23/weather-station-project/(7)
+ https://github.com/lucsmall/WH2-Weather-Sensor-Library-for-Arduino (8)
+ http://www.lostbyte.com/Arduino-OSV3/ (9) brian@lostbyte.com
+
+ Most of all thanks to Oregon Scientific, who have produced an affordable, high quality product.  I can now have my LCD Home Base in the
+ kitchen to enjoy, with the Arduino in the garage also capturing data for WWW Weather pages.  Lovely!!!!  http://www.oregonscientific.com
+ Very Highly recommended equipment. Rob Ward
+ */
+#include <Wire.h>
+#include "DHT.h"
+#include "Adafruit_BMP085.h"
+
+#define DHTTYPE DHT22   // DHT 22  (AM2302)
+#define DHTPIN 2     // what pin we're connected to
+
+Adafruit_BMP085 bmp;
+DHT dht(DHTPIN, DHTTYPE);
+
+// Read data from 433MHz receiver on digital pin 8
+#define RxPin 8            //Just an input
+#define ledPin 13          //Human feedback
+#define sDelay 230         //One Quarter Manchester Bit duration
+#define lDelay 460         //One Half Manchester Bit duration
+byte    headerHits=0;      //How many ones detected as a header bit
+boolean header    = false; //State of header detection
+boolean logic     = false; //State of the Manchester decoding
+byte    signal    = 0;     //state of RF
+boolean test230   = false;
+boolean test460   = false;
+int     maxBytes  = 11;    //sets the limits of how many data bytes will be required
+int     nosBytes  = 0;     //counter for the data bytes required
+boolean firstZero = false; //flags when the first '0' is found.
+byte    dataByte  = 0;     //accumulates the bits of the signal
+byte    dataMask  = 16;    //rotates left one bit for each Manchester bit received, so allows nybbles to be reversed on the fly
+byte    nosBits   = 0;     //counts the shifted bits in the dataByte
+byte    manchester[12];    //storage array for the data accumulated via manchester format
+byte    battery   = 0;     // Indicator byte, merge battery details into this number
+byte    quadrant  = 0;     //used to look up 16 positions around the compass rose
+double  avWindspeed = 0.0;
+double  gustWindspeed = 0.0; //now used for general anemometer readings rather than avWinspeed
+float  rainTotal = 0.0;
+float  rainRate  = 0.0;
+double  temperature = 0.0;
+int     humidity  = 0;
+double  intTemp;
+double  intHumi;
+double  intPres;
+int     scan=0; //On start up lower three bits used to show data from all sensors has been received before pooling and sending out data
+byte    activity=0;//6 Bits, Flags whether good or bad checksum for a given sensor received in last minute
+int     seconds;
+const char windDir[16][4] = {
+  "N  ", "NNE", "NE ", "ENE",  "E  ", "ESE", "SE ", "SSE",  "S  ", "SSW", "SW ", "WSW",  "W  ", "WNW", "NW ", "NNW"};
+
+void setup(){
+  Serial.begin(115200);
+  //Serial.println("Robs V3.0 WMR86 Oregon Decoder");
+  //Serial.print("Available Memory ");
+  //Serial.println(availableMemory());
+  pinMode(ledPin, OUTPUT);
+  pinMode(RxPin, INPUT);
+  digitalWrite(ledPin, HIGH);
+  delay(100);//heart beat
+  digitalWrite(ledPin, LOW);
+  headerHits=0;
+
+  //Tutorial on using the BMP05 Press/Temp transducer https://www.sparkfun.com/tutorials/253
+  bmp.begin();    //start the barometer and temp packages
+
+  // Initialize Timer1 for a 1 second interrupt
+  // Thanks to http://www.engblaze.com/ for this section, see their Interrupt Tutorial
+  cli();          // disable global interrupts
+  TCCR1A = 0;     // set entire TCCR1A register to 0
+  TCCR1B = 0;     // same for TCCR1B
+  // set compare match register to desired timer count:
+  OCR1A = 15624;
+  // turn on CTC mode:
+  TCCR1B |= (1 << WGM12);
+  // Set CS10 and CS12 bits for 1024 prescaler:
+  TCCR1B |= (1 << CS10);
+  TCCR1B |= (1 << CS12);
+  // enable timer compare interrupt:
+  TIMSK1 |= (1 << OCIE1A);
+  // enable global interrupts:
+  sei();
+}
+
+//Routine Driven by Interrupt, trap 1 second interrupts, and output CSV every minute
+ISR(TIMER1_COMPA_vect){
+  seconds++;
+  if (seconds == 60){//make 60 for each output
+    seconds = 0;
+    usbData();//comment this out to temporarily disable data every minute for debug
+    activity=0;//just a number to check if all three Tx stations have been seen.
+  }
+} //end of interrupt routine
+
+void loop(){
+  //wait here for a header!!!
+  // So far this appears as 'inverted' Manchester 1>0==1, 0>1==0 ??? (G. E. Thomas in 1949) http://en.wikipedia.org/wiki/Manchester_code
+  while (header == false){
+    while (digitalRead(RxPin)==1) { //Stay in loop while logic =1
+      //loop while the RxPin==1, first half of bit pattern, just before data transition, 1 to 0
+    }//exits when signal == 0, (1->0 falling edge found, transition to value 0) middle of bit pattern, ie the data edge
+    delayMicroseconds(sDelay); //Short wait for a 1/4 of the "1" pattern
+    if (digitalRead(RxPin) == 0){ //Check signal is still steady at 0 ( !0 = error detection)
+      delayMicroseconds(lDelay); // long wait for next 1/2 of bit pattern,
+      // ie now at 3/4 way through, looks like an ok bit "1" now keep track of how many in row we have detected
+      if (digitalRead(RxPin) == 1){ // Check Rx polarity has now swapped, good!
+        headerHits ++; // Highly likely a "1" waveform, so count it in
+        //Serial.print(headerHits);
+        //Serial.print(" ");
+        if (headerHits == 20){ //if we can find 20 in a row we will assume it is a header
+          header = true; //so we can exit this part, collect rest of header and begin data processing below
+          headerHits=0; //reset, so ready to search for another header when next required, or should an error occur in this packet
+          //Serial.println("");
+          //Serial.print("H"); //uncomment to debug header detection
+        }
+      }
+      else {
+        headerHits=0;  // Has not followed the "1" wave pattern, probably badly formed, noisy waveform, so start again
+        header=false; // make sure we look for another header
+      }
+    }
+    else {
+      headerHits=0;  // Has not followed wave pattern, probably just noise, so start again
+      header=false; // make sure we look for another header
+    }
+  }
+
+  //The program is now synch'ed to the '1' waveform and detecting the 1->0  "data" transitions in the bit waveform
+  //The data byte boundaries indicate the Synch '0' is considered a part of the data, so byte boundary begins at that '0'
+  logic=1; // look for rest of header 1's, these must be soaked up intil first 0 arrives to denote start of data
+  signal=0; //RF Signal is at 0 after 1's 1->0 transition, inverted Manchester (see Wiki, it is a matter of opinion)
+  firstZero=false; //The first zero is not immediately found, but is flagged when found
+
+  while (header == true){
+    //now get last of the header, and then store the data after trigger bit 0 arrives, and data train timing remains valid
+    while (digitalRead(RxPin)!=signal){ //halt here while signal matches inverse of logic, if prev=1 wait for sig=0
+    }//exits when signal==logic
+    delayMicroseconds(sDelay); //wait for first 1/4 of a bit pulse
+    test230 = digitalRead(RxPin);//snapshot of the input
+    if ((test230 == signal)&&(nosBytes < maxBytes)){  //after a wait the signal level is the same, so all good, continue!
+      delayMicroseconds(lDelay); //wait for second 1/2 of a bit pulse
+      test460=digitalRead(RxPin);//snapshot of the input
+      if (test230==test460){  // finds a long pulse, so the logic to look for will change, so flip the logic value
+        //Assuming the manchester encoding, a long pulse means data flips, otherwise data stays the same
+        logic = logic^1;
+        signal = signal^1;
+        //Serial.print(logic,BIN);  //debug data stream in binary
+        if (!firstZero){ //if this is the first 0->1 data transition this is the sync 0
+          digitalWrite(ledPin,1); //data processing begins, first though chew up remaining header
+          firstZero = true; //flag that legit data has begun
+          dataByte = B00000000; // set the byte as 1's (just reflects the header bit that have preceded the trigger bit=0)
+          dataMask = B00010000; // set the byte as 1's (just reflects the header bit that have preceded the trigger bit=0)
+          nosBits = 0;  // preset bit counter so we have 7 bits counted already
+          //Serial.print("!");  //debug detection of first zero
+        }
+      }
+      //data stream has been detected begin packing bits into bytes
+      if (firstZero){
+        if (logic){
+          dataByte = dataByte | dataMask; //OR the data bit into the dataByte
+        }
+        dataMask = dataMask << 1;//rotate the data bit
+        if (dataMask==0){
+          dataMask=1;//make it roll around, is there a cleaner way than this? eg dataMask *=2?
+        }
+        nosBits++;
+        if (nosBits == 8){ //one byte created, so move onto the next one
+          manchester[nosBytes] = dataByte; //store this byte
+          nosBits = 0;     //found 8, rezero and get another 8
+          dataByte = 0;    //hold the bits in this one
+          dataMask = 16;   //mask to do reversed nybbles on the fly
+          nosBytes++;      //keep a track of how many bytes we have made
+        }
+      }
+    }
+    else {
+      //non valid data found, or maxBytes equalled by nosBytes, reset all pointers and exit the while loop
+      headerHits = 0;    // make sure header search begins again
+      header = false;    // make sure we look for another header
+      firstZero = false; // make sure we look for another 0->1 transition before processing incoming stream
+      nosBytes = 0;      // either way, start again at beginning of the bank
+    }
+
+    //Temp has 10 bytes in packet, anemometer and rainfall have 11 bytes in packet
+    if (manchester[0]==0xa2){
+      maxBytes=11; //if looking for Temp then only collect 10 bytes
+    }
+    else{
+      maxBytes=10; //if Anemometer or Rainfall then we must look for 11 bytes to include 2 byte Checksum at the end
+    }
+    //look for the required number of bytes and when reached process and check the data packet
+    if (nosBytes == maxBytes){
+      if (manchester[0]==0xaf){  //detected the Thermometer and Hygrometer
+        //binBank();
+        if(ValidCS(16)){
+          //hexBank();
+          scan = scan | 1;
+          activity = activity | 1;    // indicate good CS detected
+          thermom();
+          //dumpThermom();
+        }
+        else{
+          activity = activity | 16;  // indicate bad CS detected
+        }
+      }
+      if (manchester[0]==0xa1){      //detected the Anemometer and Wind Direction
+        if(ValidCS(18)){
+          //binBank();
+          scan = scan | 2;
+          activity = activity | 2;   // indicate good CS detected
+          anemom();
+          //dumpAnemom();
+        }
+        else{
+          activity = activity | 32;  // indicate bad CS detected
+        }
+      }
+      if (manchester[0]==0xa2){      //detected the Rain Gauge
+        if(ValidCS(19)){
+          //hexBank();
+          scan = scan | 4;
+          activity = activity | 4;   // indicate good CS detected
+          rain();
+          //dumpRain();
+        }
+        else{
+          activity = activity | 64;  // indicate bad CS detected
+        }
+      }
+      headerHits = 0;                            //wind header bit hits back to 0
+      header = false;                            //Look for a new header
+      nosBytes =0;                               //reset byte pointer into bank
+      intHumi=(double)dht.readHumidity();        //DHT22 readings %Humidity
+      intTemp=(double)bmp.readTemperature();     //internal temperature
+      intPres=(double)bmp.readPressure()/100.0;  //Pa reduced to mBar
+    }
+  }
+  digitalWrite(ledPin,0); //data processing ends, look for another header
+} //  End of main loop
+
+// Formating routine for interface to host computer
+
+void usbData(){
+  // Stn Id, Packet Type, Wind Quadrant, Wind Speed, Rain Tips, Ext temp, Int Temp, Int Pressure, Int Humidity
+  if (scan == 7){  //all readings now valid
+    Serial.print(activity); // 03210321 Hi-Nybble flags failed Sensor Checksums, Lo-Nybble flags good failed Sensor Checksums
+    Serial.print(",");
+    Serial.print(battery);  // 00332211 Indicator battery level for sensors 1,2,3
+    //Not sure what these bits mean, pretty sure so called battery bits are wrong, however an Indicator byte idea is an OK Idea
+    //When and if the bits that indicate battery levels are found thye can go in here :-)
+    //I have a suspicion they may use bad checksums or some such to detect when the Tx is getting low.  However that idea has a
+    //weakness as any other Tx on 433 can scramble a packet, and each WMR86 has three Tx's all transmitting at different intervals
+    //and will inevitably cause corrupted/bad packets when they overlap. Hence I have been monitoring checksums as well.
+    Serial.print(",");
+    Serial.print(quadrant);          //0-15 in 22.5 degrees steps clockwise
+    Serial.print(",");
+    Serial.print(gustWindspeed,1);   //Gust windspeed km/hr, not average windspeed
+    Serial.print(",");
+    Serial.print(rainTotal,1);       //yet to be checked for calibration mm
+    Serial.print(",");
+    Serial.print(temperature,2);     // OS Temperature Centigrade
+    Serial.print(",");
+    Serial.print(intTemp,2);         //BMP085 temperature (used for compensation reading) Centigrade
+    Serial.print(",");
+    Serial.print(intPres,2);         //BMP085 pressure reading milli-bars
+    Serial.print(",");
+    Serial.print(intHumi);           //Digital DHT22 seems better than the OS in Temp/Hum sensor % relative
+    Serial.println();
+  }
+}
+
+//Support Routines for Nybbles and CheckSum
+
+// http://www.lostbyte.com/Arduino-OSV3/ (9) brian@lostbyte.com
+// Directly lifted, then modified from Brian's work, due to nybbles bits now in correct order MSNybble->LSNybble
+// CS = the sum of nybbles, 1 to (CSpos-1), compared to CSpos byte (LSNybble) and CSpos+1 byte (MSNybble);
+// This sums the nybbles in the packet and creates a 1 byte number, and then compared to the two nybbles beginning at CSpos
+// Note that Temp and anemometer uses only 10 bytes but rainfall use 11 bytes per packet. (Rainfall CS spans a byte boundary)
+bool ValidCS(int CSPos){
+  bool ok = false;
+  byte cs = 0;
+  for (int x=1; x<CSPos; x++){
+    byte test=nyb(x);
+    cs +=test;
+  }
+  byte check1 = nyb(CSPos);
+  byte check2 = nyb(CSPos+1);
+  byte check = (check2<<4)+check1;
+  /*
+  Serial.print(check1,HEX);  //dump out the LSNybble Checksum
+   Serial.print("(LSB), ");
+   Serial.print(check2,HEX);  //dump out the MSNybble Checksum
+   Serial.print("(MSB), ");
+   Serial.print(check,HEX);   //dump out the Rx'ed predicted byte Checksum
+   Serial.print("(combined),  calculated = ");
+   Serial.print(cs,HEX);      //dump out the calculated byte Checksum
+   Serial.print("   ");       //Space it out for the next printout
+   */
+  if (cs == check){
+    ok = true;
+  }
+  return ok;
+}
+// Get a nybble from manchester bytes, short name so equations elsewhere are neater :-)
+byte nyb(int nybble){
+  int bite = nybble / 2;       //DIV 2, find the byte
+  int nybb  = nybble % 2;      //MOD 2  0=MSB 1=LSB
+  byte b = manchester[bite];
+  if (nybb == 0){
+    b = (byte)((byte)(b) >> 4);
+  }
+  else{
+    b = (byte)((byte)(b) & (byte)(0xf));
+  }
+  return b;
+}
+
+//Calculation Routines
+
+/*   PCR800 Rain Gauge  Sample Data:
+ //  0        1        2        3        4        5        6        7        8        9        A
+ //  A2       91       40       50       93       39       33       31       10       08       02
+ //  0   1    2   3    4   5    6   7    8   9    A   B    C   D    E   F    0   1    2   3    4   5
+ //  10100010 10010001 01000000 01010000 10010011 00111001 00110011 00110001 00010000 00001000 00000010
+ //  -------- -------  bbbb---  RRRRRRRR 88889999 AAAABBBB CCCCDDDD EEEEFFFF 00001111 2222CCCC cccc
+
+ // byte(0)_byte(1) = Sensor ID?????
+ // bbbb = Battery indicator??? (7)  My investigations on the anemometer would disagree here.
+ // After exhaustive low battery tests these bbbb bits did not change
+ // RRRRRRRR = Rolling Code Byte
+ // 222211110000.FFFFEEEEDDDD = Total Rain Fall (inches)
+ // CCCCBBBB.AAAA99998888 = Current Rain Rate (inches per hour)
+ // ccccCCCC = 1 byte Checksum cf. sum of nybbles
+ // Message length is 20 nybbles so working in inches
+ Three tips caused the following
+ 1 tip=0.04 inches or 1.1mm (observed off the LCD)
+ My experiment
+ Personally I don't like this value I think mult by 25 (it was 42, then 31) and divide by 1000 should be closer to return mm directly.
+ 0.127mm per tip??? It looks close the above. Again can't vouch 100% for this, any rigorous assistance would be appreciated.
+ */
+void rain(){
+  rainTotal = float(((nyb(18)*100000)+(nyb(17)*10000)+(nyb(16)*1000)+(nyb(15)*100)+(nyb(14)*10)+nyb(13))*25/1000.0);
+  //Serial.println((nyb(18)*100000)+(nyb(17)*10000)+(nyb(16)*1000)+(nyb(15)*100)+(nyb(14)*10)+nyb(13),DEC);
+  rainRate = float(((nyb(8)*10000)+(nyb(9)*1000)+(nyb(10)*100)+(nyb(11)*10)+nyb(12))*31.0/1000.0);
+  //Serial.println((nyb(8)*10000)+(nyb(9)*1000)+(nyb(10)*100)+(nyb(11)*10)+nyb(12),DEC);
+  battery  = (battery & B00111100)| (nyb(4)>>1);//lowest 2 bits in Indicator byte is for Rain bits (unproven conc?!?!)
+}
+void dumpRain(){
+  Serial.print("Total Rain ");
+  Serial.print(rainTotal);
+  Serial.print(" mm, ");
+  Serial.print("Rain Rate ");
+  Serial.print(rainRate);
+  Serial.println(" mm/hr ");
+}
+
+// WGR800 Wind speed sensor
+// Sample Data:
+// 0        1        2        3        4        5        6        7        8        9
+// A1       98       40       8E       00       0C       70       04       00       34
+// 0   1    2   3    4   5    6   7    8   9    A   B    C   D    E   F    0   1    2   3
+// 10100001 10011000 01000000 10001110 00000000 00001100 01110000 00000100 00000000 00110100
+// -------- -------- bbbb---- NRRRRRRR xxxx9999 xxxxxxxx CCCCDDDD xxxxFFFF 0000---- CCCCcccc
+// Av Speed 0.4000000000m/s Gusts 0.7000000000m/s  Direction: N
+
+// byte(0)_byte(1) = Sensor ID?????
+// bbbb = Battery indicator??? (7)  My investigations would disagree here.  After exhaustive low battery tests these bits did not change
+// NRRRRRRR = Rolling Code Byte, the N bit is set to 1 for 64 cycles to indicate it is reset or new to the Rx box
+// 9999 = Direction
+// DDDD.CCCC = Gust Speed (m per sec)
+// 0000.FFFF = Avg Speed(m per sec)
+// multiply by 3600/1000 for km/hr
+// ccccCCCC = 1 byte checksum cf. sum of nybbles
+// packet length is 20 nybbles
+
+void anemom(){
+  //D A1 98 40 8E 08 0C 60 04 00 A4
+  avWindspeed = ((nyb(16)*10)+ nyb(15))*3.6/10;
+  gustWindspeed =((nyb(13)*10)+nyb(12))*3.6/10;
+  quadrant = nyb(9) & 0xF;
+  battery  = (battery & B00110011)|(nyb(4)<<1);//Indicator middle 2 bits (bits 2&3) in byte is Anemometer (unproven data?!?!)
+}
+void dumpAnemom(){
+  Serial.print("Av Speed ");
+  Serial.print(avWindspeed);
+  Serial.print(" km/hr, Gusts ");
+  Serial.print(gustWindspeed);
+  Serial.print(" km/hr, Direction: ");
+  Serial.print(quadrant);
+  Serial.print(" -> ");
+  Serial.println(windDir[quadrant]);
+}
+
+// THGN800 Temperature and Humidity Sensor
+// 0        1        2        3        4        5        6        7        8        9          Bytes
+// 0   1    2   3    4   5    6   7    8   9    A   B    C   D    E   F    0   1    2   3      nybbles
+// 01011111 00010100 01000001 01000000 10001100 10000000 00001100 10100000 10110100 01111001   Bits
+// -------- -------- bbbbcccc RRRRRRRR 88889999 AAAABBBB SSSSDDDD EEEE---- CCCCcccc --------   Explanation
+// byte(0)_byte(1) = Sensor ID?????
+// bbbb = Battery indicator??? (7), My investigations on the anemometer would disagree here.  After exhaustive low battery tests these bits did not change
+// RRRRRRRR = Rolling code byte
+// nybble(5) is channel selector c (Switch on the sensor to allocate it a number)
+// BBBBAAAA.99998888 Temperature in BCD
+// SSSS sign for negative (- is !=0)
+// EEEEDDDD Humidity in BCD
+// ccccCCCC 1 byte checksum cf. sum of nybbles
+// Packet length is 18 nybbles and indeterminate after that
+// H 00 01 02 03 04 05 06 07 08 09    Byte Sequence
+// D AF 82 41 CB 89 42 00 48 85 55    Real example
+// Temperature 24.9799995422 degC Humidity 40.0000000000 % rel
+void thermom(){
+  temperature = (double)((nyb(11)*100)+(nyb(10)*10)+nyb(9))/10; //accuracy to 0.01 degree seems unlikely
+  if(nyb(12)==1){//  Trigger a negative temperature
+    temperature = -1.0*temperature;
+  }
+  humidity = (nyb(14)*10)+nyb(13);
+  battery  = (battery & B00001111)|(nyb(4)<<3);//Indicator 2 bits (bits 4&5) in byte is Temperature  (unproven data?!?!)
+}
+void dumpThermom(){
+  Serial.print("Temperature ");
+  Serial.print(temperature);
+  Serial.print(" degC, Humidity ");
+  Serial.print(humidity);
+  Serial.println("% Rel");
+}
+
+// Handy Debugging Routines
+
+void binBank(){
+  //Print the fully aligned binary data in manchester[] array
+  Serial.println("D 00 00001111 01 22223333 02 44445555 03 66667777 04 88889999 05 AAAABBBB 06 CCCCDDDD 07 EEEEFFFF 08 00001111 90 22223333");
+  Serial.print("D ");
+  for( int i=0; i < maxBytes; i++){
+    byte mask = B10000000;
+    if (manchester[i]<16){
+      Serial.print("0"); //pad single digit hex
+    }
+    Serial.print(manchester[i],HEX);
+    Serial.print(" ");
+    for (int k=0; k<8; k++){
+      if (manchester[i] & mask){
+        Serial.print("1");
+      }
+      else{
+        Serial.print("0");
+      }
+      mask = mask >> 1;
+    }
+    Serial.print(" ");
+  }
+  Serial.println();
+}
+
+void hexBank(){
+  //Print the fully aligned binary data, enable the headers if desired
+  //Serial.println("H 00 01 02 03 04 05 06 07 08 09");
+  //Serial.println("  00 00 00 00 00 00 00 00 11 11");
+  //Serial.println("B 10 32 54 76 98 BA DC FE 10 32");
+  Serial.print("D ");
+  for( int i=0; i < maxBytes; i++){
+    if (manchester[i]<16){
+      Serial.print("0"); //pad single digit hex
+    }
+    Serial.print(manchester[i],HEX);
+    Serial.print(" ");
+  }
+  Serial.println();
+}
+
+int availableMemory() {
+  int size = 2048; //Arduino Uno, just keep an eye on this
+  byte *buf;
+  while ((buf = (byte *) malloc(--size)) == NULL);
+  free(buf);
+  return size;
+}
+
+
+
+
+
+


16:41/30/08

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

--- CyberGlove/Cyberglove.ino
+++ CyberGlove/Cyberglove.ino
@@ -0,0 +1,30 @@
+int pin_1 = A0;     // potentiometer wiper
+int pin_2 = A1;
+int pin_3 = A2;
+int val_1 = 0;
+int val_2 = 0;
+int val_3 = 0;
+char userInput;
+void setup()
+
+{
+
+  Serial.begin(9600);          //  setup serial
+
+}
+
+
+void loop(){
+  if (Serial.available() > 0){
+      userInput = Serial.read();
+	 if (userInput == 'y'){
+            val_1 = analogRead(pin_1);    // read the input pin
+            val_2 = analogRead(pin_2);
+            val_3 = analogRead(pin_3);
+            int val[]={val_1,val_2,val_3};
+            for (int i=0;i<=2;i++){
+    	       Serial.println(val[i]);
+	       }
+           }
+     }
+}


Remove .ino from dropbo, make sure current local directory is the sketch folder so no unecessary nested folders created. Initial push of project

--- Dremelfuge.ino
+++ Dremelfuge.ino
@@ -0,0 +1,243 @@
+class Button
+{
+  protected:
+    const uint8_t pin;
+    const bool isToggleButton;
+    uint16_t debounceDelay;
+
+    bool defaultState; // not const because the state of the button on begin() is assumed to be the defaultState
+    bool currentState;
+    unsigned long lastTimePressed;
+  public:
+    // combination of Button(byte) and Button(byte, bool) and Button(byte, bool, int) constructors via default args
+    Button(const uint8_t pin, const bool isToggleButton=false, uint16_t debounceDelay=500)
+    : pin(pin), isToggleButton(isToggleButton) // const variables can only be assigned through initialization lists
+                                               // (since they're supposed to be read-only)
+    {
+      this->debounceDelay = debounceDelay;
+      lastTimePressed = 0;
+    }
+    void setDebounceDelay(int debounceDelay)
+    {
+      this->debounceDelay = debounceDelay;
+    }
+
+    bool pressed()
+    {
+      currentState = digitalRead(pin);
+      if(currentState == !defaultState && (millis() - lastTimePressed > debounceDelay || isToggleButton == true))
+      {
+        lastTimePressed = millis();
+        return true;
+      }
+      else
+        return false;
+    }
+    void toggleWhenPressed(bool& condition)
+    {
+      if(isToggleButton)
+        condition = digitalRead(pin);
+      else if(pressed())
+        condition = !condition;
+    }
+    bool held()
+    {
+      return digitalRead(pin) == !defaultState;
+      // same behavior as pressed() for toggle buttons
+    }
+
+    //*** separated from constructor bc these functions need to be called in setup(), and object needs global scope
+    virtual void begin()
+    {
+      pinMode(pin, INPUT);
+      defaultState = digitalRead(pin);
+      currentState = digitalRead(pin);
+    }
+};
+
+class LEDButton : public Button
+{
+  private:
+    const uint8_t ledOutPin;
+
+    bool ledState;
+  public:
+    // call Button(int, int) constructor using constructor initialization list, setting inherited member data for you
+    LEDButton(const uint8_t pin, const uint8_t ledOutPin, uint16_t debounceDelay=500) : Button(pin, false, debounceDelay), ledOutPin(ledOutPin)
+    {
+      //LED off by default
+      ledState = LOW;
+    }
+
+    void ledOn()
+    {
+      ledState = HIGH;
+      digitalWrite(ledOutPin, ledState);
+    }
+    void ledOff()
+    {
+      ledState = LOW;
+      digitalWrite(ledOutPin, ledState);
+    }
+    void ledToggle()
+    {
+      ledState = !ledState;
+      digitalWrite(ledOutPin, ledState);
+    }
+
+    void begin()
+    {
+      Button::begin();                      // call base class version of begin()
+      pinMode(ledOutPin, OUTPUT);
+      digitalWrite(ledOutPin, ledState);
+    }
+};
+
+/*
+Dremelfuge ETC Project 2015-2016
+Adapted from Orlov's Instructable on Arduino Powered Centrifuge
+
+Compiled and Edited by: Albert Ju, Fu Yang Chin
+*/
+
+#include <LiquidCrystal.h>               // include the library code for display
+
+//---GLOBAL VARIABLES--//
+//*** these variables MUST be global because they're being used by multiple totally separate functions--static local won't do
+LiquidCrystal lcd = LiquidCrystal(12, 11, 5, 4, 3, 6);   // initialize the library with the numbers of the interface pins
+
+// White Pushbutton
+const uint8_t WPB_IN_PIN = 2, WPB_LED_PIN = 13;
+const unsigned int WPB_DEBOUNCE_DELAY = 500;
+LEDButton wpb = LEDButton(WPB_IN_PIN, WPB_LED_PIN, WPB_DEBOUNCE_DELAY);
+
+// PWM (Pulse-Width Modulation) Motor Control and Potentiometer
+const uint8_t MOTOR_PIN = 9;
+const uint8_t POT_PIN = A5;
+
+
+//*** No magic numbers! Using case statements, enum will provide readable, self-documenting code for when switching modes
+enum class Mode
+{
+  SETTING_TIME,
+  SETTING_SPEED,
+  SPINNING
+};
+Mode mode = Mode::SETTING_TIME;                       //*** initialization over assignment; set SETTING_TIME to be the first mode!
+
+//---Function prototypes---//
+inline void lcdPrintFormattedSecs(unsigned long seconds);
+
+void setup()
+{
+  const uint8_t LCD_COLUMNS = 20, LCD_ROWS = 4;
+
+  wpb.begin();
+  wpb.ledOn();
+
+  pinMode(MOTOR_PIN, OUTPUT);
+  pinMode(POT_PIN, INPUT);
+
+  lcd.begin(LCD_COLUMNS, LCD_ROWS);
+  lcd.setCursor(0, 0);
+  lcd.print(F("  Dremel Centrifuge"));                //*** Serial or derived functions will store their String arguments in RAM, which is wasteful; F() stores them in flash memory, where the sketch is stored (largest storage)
+  lcd.setCursor(0, 2);
+  lcd.print(F("Set speed:"));
+  lcd.setCursor(0, 3);
+  lcd.print(F("   Push to Start!"));
+
+  Serial.begin(9600);
+}
+
+void loop()
+{
+                                                      //*** static local variables--i.e. static variables inside of functions--are NOT STACK VARIABLES;
+                                                      //    their values persist even after function ends, as long as the program is still running
+                                                      //*** also, static local variables still only have local scope
+                                                      //*** perform operations with data of the same type, so as to boost performance by not needing to typecast
+  static unsigned long countdown;                     // the duration the centrifuge should run
+  static unsigned long spinningStartTime;             // point on the timeline where the countdown starts, i.e. when wpb is pressed the second time
+  static uint8_t motorSpeed;
+
+  switch(mode)
+  {
+    case Mode::SETTING_TIME:
+    {
+      countdown = map(analogRead(POT_PIN), 0, 1024, 0, 901);
+
+      lcd.setCursor(0, 1);
+      lcd.print(F("Set time: <"));
+      lcdPrintFormattedSecs(countdown);
+      lcd.print(F(">   "));
+
+      if(wpb.pressed())
+      {
+        // then implicitly set in stone the countdown value, change display, and enter next block
+        //*** because mode will change, countdown will no longer be updated by pot, so on case switch countdown will equal its final value, no further updating necessary
+
+        // Erase <> selector braces
+        lcd.setCursor(10, 1);
+        lcdPrintFormattedSecs(countdown);
+        lcd.print(F("    "));
+
+        countdown*= (long)1000;                       //*** to save space, the ATmega328P chip of UNO uses 2-byte ints, which can hold at max 32 767; operator*(int, int) will still return an int, but in this case an overflowed int;
+                                                      //*** initSetTime, a long, will just be assigned the overflowed value--it won't force operator*(int, int) to return a long.
+                                                      //*** so, by typecasting 1000 or using 1000L, you make the compiler promote analogRead() to a long, so operator*(long, long) will return the expected value, within range of sizeof long
+        mode = Mode::SETTING_SPEED;
+      }
+      break;
+    }
+
+
+    case Mode::SETTING_SPEED:
+    {
+      motorSpeed = map(analogRead(POT_PIN), 0, 1024, 0, 255);
+
+      lcd.setCursor(11, 2);
+      lcd.print(F("<"));
+      //map printing of motorSpeed to rpm range?!
+      lcd.print(motorSpeed);
+      lcd.print(F(">  "));
+
+      if(wpb.pressed())
+      {
+        // then implicitly set in stone the motorSpeed value, change display, pre-start the countdown, and switch block
+
+        // Erase <> selector braces
+        lcd.setCursor(11, 2);
+        lcd.print(motorSpeed);
+        lcd.print(F("  "));
+
+        spinningStartTime = millis();
+
+        mode = Mode::SPINNING;
+      }
+      break;
+    }
+
+
+    case Mode::SPINNING:
+    {
+      unsigned long secondsLeft = (countdown - (millis() - spinningStartTime))/1000;  //*** save RAM AND flash memory by only doing this calculation once per case in loop()
+      analogWrite(MOTOR_PIN, motorSpeed);
+
+      lcd.setCursor(0, 1);
+      lcd.print(F("Finished in: "));
+      lcdPrintFormattedSecs(secondsLeft);
+      lcd.print(F("  "));
+
+      if(wpb.pressed() || secondsLeft == 0)
+      {
+        digitalWrite(MOTOR_PIN, LOW);
+        mode = Mode::SETTING_TIME;
+      }
+      break;
+    }
+  }
+}
+
+inline void lcdPrintFormattedSecs(unsigned long seconds) //*** inline = suggestion to the compiler to paste the raw code of this function wherever it's called == performance optimization, no hopping pointers to callers and callbacks
+{
+  //***
+  lcd.print(seconds/60); lcd.print(F(":")); lcd.print((seconds%60 < 10 ? F("0") : F(""))); lcd.print(seconds%60);
+}


First version. Testing motor control.

First version. Testing motor control.

--- Pianist/Pianist.ino
+++ Pianist/Pianist.ino
@@ -0,0 +1,78 @@
+//Arduino PWM Speed Contro
+short E1 = 5;
+short M1 = 4;
+short E2 = 6;
+short M2 = 7;
+
+short ST = 2;
+
+signed int motorSpeed = 0;
+
+#include <Wire.h>
+
+void setup()
+{
+    Serial.begin(57600);
+    Wire.begin();
+    pinMode(M1, OUTPUT);
+    pinMode(M2, OUTPUT);
+    pinMode(E1, OUTPUT);
+    pinMode(E2, OUTPUT);
+    pinMode(ST, INPUT);
+}
+
+void loop()
+{
+  Serial.println("Hallo Welt!.");
+  delay(3000);
+  Serial.println("Calibrating...");
+  delay(3000);
+  Calibrate();
+  Serial.println("Done.");
+  while(true);
+}
+
+void Calibrate()
+{
+  for (short i = 0; i < 3; i++)
+  {
+  Serial.println("Going left...");
+  if (digitalRead(ST) == HIGH)
+  {
+    SetMotorSpeed(-255);
+    while(digitalRead(ST) == HIGH)
+    {
+      ;
+    }
+    SetMotorSpeed(0);
+  }
+  Serial.println("Going right...");
+  SetMotorSpeed(200);
+  while(digitalRead(ST) == LOW)
+  {
+    ;
+  }
+  }
+  SetMotorSpeed(0);
+}
+
+
+void SetMotorSpeed(signed int motorSpeed)
+{
+  if (motorSpeed < 0)
+  {
+    digitalWrite(M1, HIGH);
+  }
+  else
+  {
+    digitalWrite(M1, LOW);
+  }
+
+  int ms = abs(motorSpeed);
+  if (ms > 255)
+  {
+    ms = 255;
+  }
+  analogWrite(E1, ms);
+}
+


Added file

Added file

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

--- SteeringAcceleration.ino
+++ SteeringAcceleration.ino
@@ -0,0 +1,160 @@
+/*************************************************************
+Motor Shield 1-Channel DC Motor Demo
+by Randy Sarafan
+
+For more information see:
+http://www.instructables.com/id/Arduino-Motor-Shield-Tutorial/
+
+*************************************************************/
+#include <Servo.h>
+
+Servo VishalServo;
+
+void setup() {
+  Serial.begin(9600);
+  Serial.println("SmartCar");
+  //Setup Channel A
+  pinMode(12, OUTPUT); //Initiates Motor Channel A pin
+  pinMode(9, OUTPUT); //Initiates Brake Channel A pin
+
+  //Setup Channel B
+  pinMode(13, OUTPUT); //Initiates Motor Channel A pin
+  pinMode(8, OUTPUT); //Initiates Brake Channel A pin
+  VishalServo.attach(10);
+
+  //This is for the led lamp
+  //pinMode(6, OUTPUT);
+
+  //VishalServo.writeMircoseconds(1500);
+  Serial.println("Wait for 1 second");
+  delay(1000);
+  Serial.println("1=Forward");
+  Serial.println("2=Backward");
+  Serial.println("3=ForwardLeft");
+  Serial.println("4=ForwardRight");
+  Serial.println("5=Break");
+  Serial.println("6=BackwardLeft");
+  Serial.println("7=BackwardRight");
+  Serial.println("8=360ClockSpinFlip");
+  Serial.println("9=REVERSED360ClockSpinFlip");
+
+}
+
+void loop(){
+
+  while(Serial.available()==0);
+  int val = Serial.read()-'0';
+  int i = VishalServo.read();
+
+  //backward @ full speed
+  if(val==2){
+  digitalWrite(9, HIGH); //Eengage the Brake for Channel A
+  digitalWrite(8, HIGH); //Eengage the Brake for Channel B
+
+  digitalWrite(12, HIGH); //Establishes backward direction of Channel A
+  digitalWrite(9, LOW);   //Disengage the Brake for Channel A
+  analogWrite(3, 123);   //Spins the motor on Channel A at full speed
+
+  digitalWrite(13, LOW); //Establishes backward direction of Channel B
+  digitalWrite(8, LOW);   //Disengage the Brake for Channel B
+  analogWrite(11, 123);   //Spins the motor on Channel B at full speed
+
+  delay(3000);
+  }
+
+  //This is for the break
+  if(val==5){
+  digitalWrite(9, HIGH); //Eengage the Brake for Channel A
+  digitalWrite(8, HIGH); //Eengage the Brake for Channel B
+
+  delay(1000);
+  }
+
+  //forward @ full speed
+  if(val==1){
+  digitalWrite(9, HIGH); //Eengage the Brake for Channel A
+  digitalWrite(8, HIGH); //Eengage the Brake for Channel B
+
+  digitalWrite(12, LOW); //Establishes forward direction of Channel A
+  digitalWrite(9, LOW);   //Disengage the Brake for Channel A
+  analogWrite(3, 123);   //Spins the motor on Channel A at half speed
+
+  digitalWrite(13, HIGH); //Establishes forward direction of Channel B
+  digitalWrite(8, LOW);   //Disengage the Brake for Channel B
+  analogWrite(11, 123);   //Spins the motor on Channel B at half speed
+
+  delay(3000);
+  }
+
+
+  //This is for turning forward Left
+  if(val==3){
+  digitalWrite(9, HIGH); //Eengage the Brake for Channel A
+  digitalWrite(8, HIGH); //Eengage the Brake for Channel B
+
+  digitalWrite(12, LOW); //Establishes Forward direction of Channel A
+  digitalWrite(9, LOW);   //Disengage the Brake for Channel A
+  analogWrite(3, 255);   //Spins the motor on Channel A at full speed
+
+  }
+  //This is for turning forward right
+
+  if(val==4){
+  digitalWrite(9, HIGH); //Eengage the Brake for Channel A
+  digitalWrite(8, HIGH); //Eengage the Brake for Channel B
+
+  digitalWrite(13, HIGH); //Establishes Forward direction of Channel B
+  digitalWrite(8, LOW);   //Disengage the Brake for Channel B
+  analogWrite(11, 255);   //Spins the motor on Channel B at full speed
+  }
+
+  //This is for turning backward Left
+  if(val==6){
+  digitalWrite(9, HIGH); //Eengage the Brake for Channel A
+  digitalWrite(8, HIGH); //Eengage the Brake for Channel B
+
+  digitalWrite(12, HIGH); //Establishes Backward direction of Channel A
+  digitalWrite(9, LOW);   //Disengage the Brake for Channel A
+  analogWrite(3, 255);   //Spins the motor on Channel A at full speed
+  }
+  //This is for turning backward Right
+  if(val==7){
+  digitalWrite(9, HIGH); //Eengage the Brake for Channel A
+  digitalWrite(8, HIGH); //Eengage the Brake for Channel B
+
+  digitalWrite(13, LOW); //Establishes Backward direction of Channel A
+  digitalWrite(8, LOW);   //Disengage the Brake for Channel A
+  analogWrite(11, 255);   //Spins the motor on Channel A at full speed
+  }
+  //clockSpin360flip
+  if(val==8){
+  digitalWrite(9, HIGH); //Eengage the Brake for Channel A
+  digitalWrite(8, HIGH); //Eengage the Brake for Channel B
+
+  digitalWrite(13, HIGH); //Establishes Forward direction of Channel b
+  digitalWrite(8, LOW);   //Disengage the Brake for Channel b
+  analogWrite(11, 255);   //Spins the motor on Channel b at full speed
+
+  digitalWrite(12, HIGH); //Establishes backward direction of Channel A
+  digitalWrite(9, LOW);   //Disengage the Brake for Channel A
+  analogWrite(3, 255);   //Spins the motor on Channel A at full speed
+
+}
+  //ANTICLOCKSPIN360fli
+  if(val==9){
+  digitalWrite(9, HIGH); //Eengage the Brake for Channel A
+  digitalWrite(8, HIGH); //Eengage the Brake for Channel B
+
+  digitalWrite(13, LOW); //Establishes Backward direction of Channel b
+  digitalWrite(8, LOW);   //Disengage the Brake for Channel b
+  analogWrite(11, 255);   //Spins the motor on Channel b at full speed
+
+  digitalWrite(12, LOW); //Establishes Forward direction of Channel A
+  digitalWrite(9, LOW);   //Disengage the Brake for Channel A
+  analogWrite(3, 255);   //Spins the motor on Channel A at full speed
+
+}
+
+}
+Arduino Motor Shield Tutorial
+www.instructables.com


Added Gsr Script

Added Gsr Script

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

--- GSR_Script/GSR_Script.ino
+++ GSR_Script/GSR_Script.ino
@@ -0,0 +1,20 @@
+#include <eHealth.h>
+
+extern volatile unsigned long timer0_overflow_count;
+float fanalog0;
+int analog0;
+unsigned long time;
+byte serialByte;
+
+void setup() {
+  Serial.begin(9600);
+}
+
+void loop() {
+  while(1)
+  {
+    fanalog0=eHealth.getSkinConductance();
+    Serial.println(fanalog0,5);
+    delay(20);
+  }
+}


hmm, let's see if we can work with interrupts … no!


Skeleton code for smart meter tap (untested)

--- smartmetertap/smartmetertap.ino
+++ smartmetertap/smartmetertap.ino
@@ -0,0 +1,21 @@
+#include <Arduino.h>
+#include <SoftwareSerial.h>
+
+#define SERIAL_RX_PIN D5
+#define BUFFER_SIZE_BYTES 64
+
+SoftwareSerial p1(SERIAL_RX_PIN, -1, true, BUFFER_SIZE_BYTES);
+
+void setup() {
+  p1.begin(115200);
+
+  Serial.begin(115200);
+  Serial.println("Up and running");
+}
+
+void loop() {
+  if (p1.available()) {
+    int byte = p1.read();
+    Serial.write(byte);
+  }
+}


Use a define instead of an in-function int.

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


Optimise data types

Optimise data types

fatal: remote error: upload-pack: not our ref 8294d4fe57c08e0f3964bb77032527c74777ca60
fatal: the remote end hung up unexpectedly


Added simple example.

Added simple example.

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

--- examples/basic_test/basic_test.ino
+++ examples/basic_test/basic_test.ino
@@ -0,0 +1,28 @@
+
+#include <EEPROM.h>
+#include <EEWrap.h>
+
+//Use the xxx_e types rather than the standard types like uint8_t
+struct Foo{
+  uint8_e a;
+  int16_e b;
+  float_e c;
+};
+
+Foo foo EEMEM; //EEMEM tells the compiler that the object resides in the EEPROM
+
+void setup(){
+
+  //Write to values stored in EEPROM
+  foo.a = 45;
+  foo.b = 12345;
+  foo.c = 3.1415;
+
+  //Print values from EEPROM
+  Serial.begin(9600);
+  Serial.println(foo.a);
+  Serial.println(foo.b);
+  Serial.println(foo.c);
+}
+
+void loop() {}


add a dot down script

add a dot down script

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

--- a_dot_down/a_dot_down.ino
+++ a_dot_down/a_dot_down.ino
@@ -0,0 +1,44 @@
+/*
+from Adafrute I2C LED matrix8x8 example.
+https://github.com/adafruit/Adafruit-LED-Backpack-Library
+*/
+
+/*
+One LED light moves through (1,1) to (8,8),
+*/
+
+#include <Wire.h>
+#include "Adafruit_LEDBackpack.h"
+#include "Adafruit_GFX.h"
+
+Adafruit_8x8matrix matrix = Adafruit_8x8matrix ();
+
+void setup ()
+{
+  matrix.begin (0x70);
+  matrix.clear();
+  matrix.writeDisplay();
+
+}
+
+ int col_row ;
+ static const int lightdot = 128;
+ // 128 == B100000000
+ static const int none = 0;
+ static const uint8_t PROGMEM
+ mymap[] = {lightdot, none, none, none,
+          none, none, none, none };
+
+
+void loop()
+{
+ for(col_row = 0; col_row < 8; col_row++)
+ {
+    matrix.drawBitmap(col_row, col_row, mymap,
+      col_row+1, col_row+1, LED_ON);
+    matrix.writeDisplay();
+    delay(500);
+    matrix.clear();
+    matrix.writeDisplay();
+ }
+}


Rename Example

Rename Example

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

--- examples/01.Digital/ButtonLed/ButtonLed.ino
+++ examples/01.Digital/ButtonLed/ButtonLed.ino
@@ -0,0 +1,18 @@
+#include <ParkingShield.h>
+
+ParkingShield shield;
+
+void setup()
+{
+  // put your setup code here, to run once:
+  Serial.begin(9600);
+}
+
+void loop()
+{
+  // Enables LEDs by Boolean expressions
+  shield.setLed(ParkingShield::GREEN_LED,   shield.buttonS1Pressed() && !shield.buttonS2Pressed());
+  shield.setLed(ParkingShield::YELLOW_LED, !shield.buttonS1Pressed() &&  shield.buttonS2Pressed());
+  shield.setLed(ParkingShield::RED_LED,     shield.buttonS1Pressed() &&  shield.buttonS2Pressed());
+}
+


initial push of ECS control sketch

initial push of ECS control sketch

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

--- examples/ECS_therm/ECS_therm.ino
+++ examples/ECS_therm/ECS_therm.ino
@@ -0,0 +1,174 @@
+#include <ESP8266WiFi.h>
+#include <OneWire.h>
+#include <DallasTemperature.h>
+#include <PubSubClient.h>
+
+//Constants
+#define SENSOR_ID "ECS"
+#define PROBE_TEMPO 60000
+#define ONE_WIRE_BUS D4  // DS18B20 pin
+OneWire oneWire(ONE_WIRE_BUS);
+DallasTemperature DS18B20(&oneWire);
+
+float oldTemp;
+
+
+/************************* WiFi Access Point *********************************/
+
+#define WLAN_SSID       "SFR_34A8"
+#define WLAN_PASS       "ab4ingrograstanstorc"
+
+
+/************************* MQTT *********************************/
+
+const char* mqtt_server = "192.168.1.27";
+
+/************ Global State (you don't need to change this!) ******************/
+
+// Create an ESP8266 WiFiClient class to connect to the MQTT server.
+WiFiClient espClient;
+// or... use WiFiFlientSecure for SSL
+//WiFiClientSecure client;
+
+// Setup the MQTT client class by passing in the WiFi client and MQTT server and login details.
+PubSubClient client(espClient);
+
+
+long lastMsg = 0;
+char msg[50];
+int value = 0;
+
+
+/****************************** Wifi connect function ***************************************/
+void setup_wifi() {
+
+  delay(10);
+  // We start by connecting to a WiFi network
+  Serial.println();
+  Serial.print("Connecting to ");
+  Serial.println(WLAN_SSID);
+
+  WiFi.begin(WLAN_SSID, WLAN_PASS);
+
+  while (WiFi.status() != WL_CONNECTED) {
+    delay(500);
+    Serial.print(".");
+  }
+
+  randomSeed(micros());
+
+  Serial.println("");
+  Serial.println("WiFi connected");
+  Serial.println("IP address: ");
+  Serial.println(WiFi.localIP());
+}
+
+void callback(char* topic, byte* payload, unsigned int length) {
+  Serial.print("Message arrived [");
+  Serial.print(topic);
+  Serial.print("] ");
+  for (int i = 0; i < length; i++) {
+    Serial.print((char)payload[i]);
+  }
+  Serial.println();
+
+  // Switch on the LED if an 1 was received as first character
+  if ((char)payload[0] == '1') {
+    Serial.println("Ping received");
+    String tmp_string = SENSOR_ID;
+    tmp_string += "says : I'm alive!!!!";
+
+    client.publish("connection_events", tmp_string.c_str());
+
+  } else {
+    Serial.println("doing nothing");
+
+  }
+
+}
+
+
+void reconnect() {
+  // Loop until we're reconnected
+  while (!client.connected()) {
+    Serial.print("Attempting MQTT connection...");
+    // Create a random client ID
+    String clientId = SENSOR_ID;
+
+    // Attempt to connect
+    if (client.connect(clientId.c_str())) {
+      Serial.println("connected");
+      // Once connected, publish an announcement...
+      String connectMsg = "New connection from " + clientId;
+      client.publish("connection_events", connectMsg.c_str());
+      // ... and resubscribe
+      String tmp_string = "ping";
+      tmp_string += clientId;
+
+      client.subscribe(tmp_string.c_str());
+    }
+    else {
+      Serial.print("failed, rc=");
+      Serial.print(client.state());
+      Serial.println(" try again in 5 seconds");
+      // Wait 5 seconds before retrying
+      delay(5000);
+    }
+  }
+}
+
+
+void setup() {
+  Serial.begin(115200);
+
+  setup_wifi();
+  client.setServer(mqtt_server, 1883);
+  client.setCallback(callback);
+
+
+
+
+}
+
+void loop() {
+  float temp;
+
+  if (!client.connected()) {
+    reconnect();
+  }
+  client.loop();
+
+  long now = millis();
+
+  if (now - lastMsg > PROBE_TEMPO) {
+      lastMsg = now;
+
+      //Read data and store it to variables hum and temp
+      DS18B20.requestTemperatures();
+      temp = DS18B20.getTempCByIndex(0);
+      Serial.print("Temperature: ");
+      Serial.println(temp);
+
+      if (temp == 85.0 || temp == (-127.0)) {
+          Serial.println("Failed to read from sensor!");
+      }
+      else
+      {
+
+
+          //send to MQTT server
+          snprintf (msg, 75, "%.1f", temp);
+          Serial.print("Publish message: ");
+          Serial.println(msg);
+          String outTopicPrefix = SENSOR_ID;
+          String outTopicTemp = outTopicPrefix + "/temp";
+          client.publish(outTopicTemp.c_str(), msg);
+
+      }
+  }
+
+
+
+
+}
+


Add files via upload

Add files via upload

arduino patch to trigger heatpad

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/invisibleFlock/holdprototypes.git/'


Adding the Arduino to cSound library

Adding the Arduino to cSound library

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


Just comments

Just comments

Commented program executor to know the sequence of actions

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/ivegotasthma/washmashine.git/'


arduino code

arduino code

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


Create sensor_system.ino

Create sensor_system.ino

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

--- arduino/sensor_system.ino
+++ arduino/sensor_system.ino
@@ -0,0 +1,96 @@
+/*
+ *
+ * Authors: Jeffrey Leung, Charles Li, Mina Li, Paul Pinto
+ * Last edited: 2016-03-19
+ *
+ * This Arduino sketch detects the activation of pressure pads by the presence
+ * of an item and sends the result using Bluetooth communication to the
+ * car system.
+ *
+ */
+
+#include <SoftwareSerial.h>
+
+const unsigned int pinPressureEssential = A0;
+const unsigned int pinPressureGeneral = A1;
+const unsigned int pinCapacitive = A2;
+
+const unsigned int pinPressureEssentialPower = 7;
+const unsigned int pinPressureGeneralPower = 6;
+const unsigned int pinCapacitivePower = 5;
+
+const unsigned int pinPowerLED = 13;
+const unsigned int pinEssentialLED = 12;
+const unsigned int pinGeneralLED = 11;
+
+// Calibrated to the individual sensors
+const unsigned int thresholdPressureEssential = 700;
+const unsigned int thresholdPressureGeneral = 700;
+const unsigned int thresholdCapacitive = 200;
+
+// States
+bool powerOn = true;
+bool powerToggled = false;
+
+static unsigned long minuteCounter;
+unsigned long delay_hours;
+unsigned long delay_minutes;
+
+// Serial connections
+SoftwareSerial serialCarSystem(2, 3);  // Pins 2, 3
+
+// This method returns whether the given input pin reads greater than
+// the given threshold.
+bool SensorGreaterThan(const unsigned int pin, const unsigned int threshold) {
+  return analogRead(pin) > threshold;
+}
+
+// This method counts down by a single minute when a minute has passed.
+void MinuteSet() {
+  if(minuteCounter < millis()) {
+
+    if(delay_minutes == 0 && delay_hours > 0) {
+      --delay_hours;
+      delay_minutes = 59;
+    }
+    else if(delay_minutes > 0) {
+      --delay_minutes;
+    }
+
+    minuteCounter = millis()+(60*1000);
+  }
+}
+
+// This method sets a new delay time.
+void SetDelayTime(const unsigned long hours, const unsigned long minutes) {
+  delay_hours = hours;
+  delay_minutes = minutes;
+}
+
+void setup() {
+  Serial.begin(9600);
+  serialCarSystem.begin(9600);
+
+  // Pin outputs
+  pinMode(pinPressureEssential, INPUT);
+  pinMode(pinPressureGeneral, INPUT);
+
+  pinMode(pinPressureEssentialPower, OUTPUT);
+  pinMode(pinPressureGeneralPower, OUTPUT);
+  pinMode(pinCapacitivePower, OUTPUT);
+  digitalWrite(pinPressureEssentialPower, HIGH);
+  digitalWrite(pinPressureGeneralPower, HIGH);
+  digitalWrite(pinCapacitivePower, HIGH);
+
+  pinMode(pinPowerLED, OUTPUT);
+  pinMode(pinEssentialLED, OUTPUT);
+  pinMode(pinGeneralLED, OUTPUT);
+  digitalWrite(pinPowerLED, HIGH);
+  digitalWrite(pinEssentialLED, LOW);
+  digitalWrite(pinGeneralLED, LOW);
+
+  minuteCounter = millis()+(60*1000);
+}
+
+void loop(){
+


Create PC_v099b0311.ino

Create PC_v099b0311.ino

error: pathspec 'Particle' did not match any file(s) known to git
error: pathspec 'Photon' did not match any file(s) known to git
error: pathspec 'based/code/PC_v099b0311.ino' did not match any file(s) known to git


Use atmega328p

Use atmega328p

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

--- receiver_analog/receiver_analog.ino
+++ receiver_analog/receiver_analog.ino
@@ -0,0 +1,206 @@
+
+
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>    // Sleep Modes
+#include <avr/power.h>    // Power management
+#include <VirtualWire.h>
+
+#define PWM_PIN 9 // TMP until dedicated chip arrives
+
+#define VW_MAX_MESSAGE_LEN 40 // Same as solar/sensor
+#define VW_RX_PIN 7 // PD7 (13)
+#define RF_POWER_PIN 8 // PB0 (14) Toggle power to RF receiver
+
+#define WD_DO_STUFF 1 // How many watchdog interupts before doing real work.
+
+
+
+
+byte pwm_val = 127; // Temporary half value
+volatile byte wd_isr = WD_DO_STUFF;
+
+byte count = 10;
+
+ISR(WDT_vect)
+{
+  // Wake up by watchdog
+  if (wd_isr == 0) {
+      wd_isr = WD_DO_STUFF;
+  } else {
+      --wd_isr;
+      // Go back to sleep.
+      goToSleep();
+  }
+}
+
+void setup()
+{
+  // disable ADC
+  ADCSRA = 0;
+
+  // disable analog comparitor
+  ACSR = (1 << ACD) | (0 << ACIE);
+
+  watchdog_setup();
+  pinMode(RF_POWER_PIN, OUTPUT);
+  digitalWrite(RF_POWER_PIN, HIGH);
+
+  pinMode(PWM_PIN, OUTPUT);  // TMP until dedicated chip arrives
+  analogWrite(PWM_PIN, pwm_val);
+
+  Serial.begin(9600);
+  Serial.println("Setup");
+
+  vw_set_rx_pin(VW_RX_PIN);
+  vw_setup(2000);	 // Bits per sec
+  vw_rx_start();       // Start the receiver running
+}
+
+
+void loop()
+{
+  --count;
+  if (count == 0) {
+    count = 10;
+    goToSleep();
+  }
+
+  // Reset watchdog so he knows all is well.
+  wdt_reset();
+
+  uint8_t buf[VW_MAX_MESSAGE_LEN];
+  uint8_t buflen = VW_MAX_MESSAGE_LEN;
+
+
+  if (vw_get_message(buf, &buflen)) { // Non-blocking
+    int i;
+    int val = 0;
+    byte comma = 0;
+    for (i = 0; i < buflen; i++) {
+
+
+
+      if (buf[i] == 44) {
+        // CSV - S,88,20.17,21.91,871,5595,5436
+        // comma 5 = solar panel reading
+        // comma 6 = battery reading
+
+        if (comma == 5) {
+          pwm_val = map(val, 0, 10000, 0, 255);
+          analogWrite(PWM_PIN, pwm_val);
+
+          // Print the solar reading
+          //Serial.print(" pwm(");
+          //Serial.print(pwm_val, DEC);
+          //Serial.print(")");
+        }
+
+        ++comma;
+        val = 0;
+      }
+
+
+      Serial.write(char(buf[i]));
+
+
+      if (comma == 5 || comma == 6) {
+        byte c = buf[i];
+        // Only interested in numbers.
+        // ASCII hex values 0x30 to 0x30 are decimal 0 to 9
+        if (c > 0x2F && c < 0x3A) {
+            if (val > 0) {
+                // Expecting decimal numbers like 24,
+                // so for each new argument multiply by ten.
+                val *= 10;
+                val += c - 0x30;
+            } else {
+                val = c - 0x30;
+            }
+            //Serial.print(val, DEC);
+        }
+      }
+
+
+    }
+
+
+    // Print the battery reading
+    //Serial.print(" Bat(");
+    //Serial.print(val, DEC);
+    //Serial.print(")");
+
+
+    Serial.println();
+
+  }
+
+
+  _delay_ms(500); // VERY TEMP
+}
+
+
+/**
+ * Watchdog for while awake to ensure things are ticking over.
+ */
+void watchdog_setup()
+{
+  // Clear any previous watchdog interupt
+  MCUSR = 0;
+
+  // WD interrupt after 8 seconds,
+  // unless wdt_reset(); has been successfully called
+
+  /* In order to change WDE or the prescaler, we need to
+   * set WDCE (This will allow updates for 4 clock cycles).
+   */
+  WDTCSR |= (1<<WDCE) | (1<<WDE);
+
+  /* set new watchdog timeout prescaler value */
+  WDTCSR = 1<<WDP0 | 1<<WDP3; // 8.0 seconds
+
+  /* Enable the WD interrupt (note no reset). */
+  WDTCSR |= _BV(WDIE);
+
+  wdt_reset();
+}
+
+void goToSleep()
+{
+
+  // Turn off the RF receiver
+  digitalWrite(RF_POWER_PIN, LOW);
+
+
+  cli();
+
+  // ensure ADC is off
+  ADCSRA = 0;
+
+  set_sleep_mode(SLEEP_MODE_PWR_DOWN);
+  power_all_disable();
+
+  // Power-down unused stuff - keep timer1 running for the pwm
+  // off - timer0, USI, ADC
+  //PRR = (0 << PRTIM1) | (1 << PRTIM0) | (1 << PRUSI) | (1 << PRADC);
+
+  sleep_enable();
+  sei();
+
+  // turn off brown-out enable in software
+  MCUCR = bit (BODS) | bit (BODSE);  // turn on brown-out enable select
+  MCUCR = bit (BODS);        // this must be done within 4 clock cycles of above
+  sleep_cpu();              // sleep within 3 clock cycles of above
+
+  sleep_disable();
+  MCUSR = 0; // clear the reset register
+
+  power_all_enable();
+
+  // Turn timer0 back on
+  //PRR = (0 << PRTIM1) | (0 << PRTIM0) | (1 << PRUSI) | (1 << PRADC);
+
+  // turn on the RF receiver
+  digitalWrite(RF_POWER_PIN, HIGH);
+
+}


Add a file to control sabertooth board

Add a file to control sabertooth board

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

--- HBridgePWM/Sabertooth/Sabertooth.ino
+++ HBridgePWM/Sabertooth/Sabertooth.ino
@@ -0,0 +1,34 @@
+// Software Serial Sample
+// Copyright (c) 2012 Dimension Engineering LLC
+// See license.txt for license details.
+
+#include <SoftwareSerial.h>
+#include <SabertoothSimplified.h>
+
+SoftwareSerial SWSerial(NOT_A_PIN, 11); // RX on no pin (unused), TX on pin 11 (to S1).
+SabertoothSimplified ST(SWSerial); // Use SWSerial as the serial port.
+
+void setup()
+{
+  SWSerial.begin(9600);
+}
+
+void loop()
+{
+  int power;
+
+  // Ramp from -127 to 127 (full reverse to full forward), waiting 20 ms (1/50th of a second) per value.
+  for (power = -127; power <= 127; power ++)
+  {
+    ST.motor(1, power);
+    delay(20);
+  }
+
+  // Now go back the way we came.
+  for (power = 127; power >= -127; power --)
+  {
+    ST.motor(1, power);
+    delay(20);
+  }
+}
+


Create ledblink.ino

Create ledblink.ino

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

--- sFDW/examples/ledblink/ledblink.ino
+++ sFDW/examples/ledblink/ledblink.ino
@@ -0,0 +1,47 @@
+/*
+  Blink sketch for sFDW library
+  Turns on an 4 LEDs on for one second in sequence,
+  then off all at once, then on all at once, after on all at once,
+  and turn off all 4 LEDs separately.
+  And all this actions repeatedly.
+  Functions of this library:
+	- sPin(pin №, pin HIGH/LOW status <1/0> )
+	- mPinsStateHigh(pins numbers for HIGH state switch, as array - separate by ",")
+	- mPinsStateLow(pins numbers for LOW state switch, as array - separate by ",")
+  Created by Dmitry Pogudo-Georgov, December 3, 2014.
+  This example code is in the public domain.
+ */
+
+// Pins 6,7,8,9 has an LEDs connected on most Arduino boards.
+#include <sFDW.h>
+
+// the setup routine runs once when you press reset:
+void setup() {}
+
+// the loop routine runs over and over again forever:
+void loop() {
+  sFDW.sPin(6,1);   // turn the LED on (HIGH is the voltage level)
+  delay(1000);               // wait for a second
+  sFDW.sPin(7,1);
+  delay(1000);
+  sFDW.sPin(8,1);
+  delay(1000);
+  sFDW.sPin(9,1);
+  delay(1000);
+
+  sFDW.mPinsStateLow(6,7,8,9);  // turn the LED off by making the voltage LOW in all ours pins
+  delay(1000);                  // wait for a second
+
+  sFDW.mPinsStateHigh(6,7,8,9); // turn the LED on by making the voltage HIGH in all ours pins
+  delay(1000);                  // wait for a second
+
+  sFDW.sPin(6,0);   // turn the LED off (LOW is the voltage level)
+  delay(1000);               // wait for a second
+  sFDW.sPin(7,0);
+  delay(1000);
+  sFDW.sPin(8,0);
+  delay(1000);
+  sFDW.sPin(9,0);
+  delay(1000);
+
+}


Let's get this small-commits thing right! Now we're sending our actual expected payload.

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/hooroo/moteino_build_lights.git/'


Added a simple example that sets accelerometer based on LED

error: pathspec 'examples/LightBlueBean/01.Basics/SettingLEDFromAccelerometer/SettingLEDFromAccelerometer.ino' did not match any file(s) known to git

--- examples/LightBlueBean/01.Basics/SettingLEDFromAccelerometer/SettingLEDFromAccelerometer.ino
+++ examples/LightBlueBean/01.Basics/SettingLEDFromAccelerometer/SettingLEDFromAccelerometer.ino
@@ -0,0 +1,34 @@
+/*
+  Led from Acceleromter.
+
+  Read the accelerometer every half second.
+  Set the LED to something based on what we read.
+  */
+
+// the setup routine runs once when you press reset:
+void setup() {
+  // initialize serial communication at 57600 bits per second:
+  Serial.begin(57600);
+}
+
+// the loop routine runs over and over again forever:
+void loop() {
+    LED_SETTING_T setting = {0, 0, 0};
+    ACC_READING_T accel = {0, 0, 0};
+
+    if(Serial.accelRead(&accel) != 0){
+     //Serial.print("Error reading\n");
+    }
+    else {
+       // 0 -> 2400 / 10 == range of 0 -> 240. Pretty good for our LED
+       setting.red = (accel.xAxis + 1200) / 10;
+       setting.green = (accel.yAxis + 1200) / 10;
+       setting.blue = (accel.zAxis + 1200) / 10;
+       Serial.ledSet(setting);
+    }
+
+    delay(500);
+}
+
+
+


chaos

chaos

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


Update btSerial.ino

Update btSerial.ino

error: pathspec 'source/bluetooth' did not match any file(s) known to git
error: pathspec 'customization/btSerial.ino' did not match any file(s) known to git


okay

okay

the poscomp was also not buffered


update

update

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

--- digitalbuttons_capsens_promicro3/digitalbuttons_capsens_promicro3.ino
+++ digitalbuttons_capsens_promicro3/digitalbuttons_capsens_promicro3.ino
@@ -0,0 +1,61 @@
+  #include <CapacitiveSensor.h>
+
+//Buttons
+int numbts = 10;
+int bts[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 16};
+boolean bgates[10];
+//Capacitive Sensors
+int numcps = 2;
+//CapacitiveSensor cps[] = {CapacitiveSensor(21, 14), CapacitiveSensor(21, 15), CapacitiveSensor(21, 18), CapacitiveSensor(21, 19), CapacitiveSensor(21, 20)};
+CapacitiveSensor cps[] = {CapacitiveSensor(21, 14), CapacitiveSensor(21, 15)};
+//CapacitiveSensor cps[] = {CapacitiveSensor(21, 14)};
+boolean cpsgates[2];
+long cpsval[2];
+void setup() {
+  Serial.begin(9600);
+  for (int i = 0; i < numbts; i++) pinMode(bts[i], INPUT_PULLUP);
+  for (int i = 0; i < numbts; i++) bgates[i] = false;
+  for (int i = 0; i < numcps; i++) cpsgates[i] = true;
+}
+
+void loop() {
+  //buttons
+  for (int i = 0; i < numbts; i++) {
+    if (!bgates[i]) {
+      if (digitalRead(bts[i]) == LOW) {
+        bgates[i] = true;
+        Serial.print("bt" + String(i) + ":");
+        Serial.println(1, DEC);
+      }
+    }
+    if (bgates[i]) {
+      if (digitalRead(bts[i]) == HIGH) {
+        bgates[i] = false;
+        Serial.print("bt" + String(i) + ":");
+        Serial.println(0, DEC);
+      }
+    }
+  }
+  //Capacitive Sensors
+ //long val = cps[0].capacitiveSensor(30);
+ // Serial.println(val);
+  for (int i = 0; i < numcps; i++) {
+    cpsval[i] = cps[i].capacitiveSensor(30);
+    if (cpsval[i] >= 4000) {
+      if (cpsgates[i]) {
+        cpsgates[i] = false;
+        Serial.print("cs" + String(i) + ":");
+        Serial.println(1, DEC);
+      }
+    }
+    else if (cpsval[i] < 3000) {
+      if (!cpsgates[i]) {
+        cpsgates[i] = true;
+        Serial.print("cs" + String(i) + ":");
+        Serial.println(0, DEC);
+      }
+    }
+  }
+
+  delay(15);
+}


strip initialization

strip initialization

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

--- init.ino
+++ init.ino
@@ -0,0 +1,29 @@
+/* Initialization Code for the Dorm LED System */
+
+void set_pin_modes() {
+  pinMode(STRIP_PIN_W1, OUTPUT);
+  pinMode(STRIP_PIN_W2, OUTPUT);
+  pinMode(STRIP_PIN_W3, OUTPUT);
+  pinMode(STRIP_PIN_D1, OUTPUT);
+  pinMode(STRIP_PIN_D2, OUTPUT);
+}
+
+void init_strips() {
+  // Window Strips
+  window1.begin();
+  window1.show();
+
+  window2.begin();
+  window2.show();
+
+  window3.begin();
+  window3.show();
+
+  // Desk Strips
+  desk1.begin();
+  desk1.show();
+
+  desk2.begin();
+  desk2.show();
+}
+


Added RQ_SET_VALUE and RQ_SET_MODE commands.

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/RichoM/Uzi.git/'


add arduino file

add 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,207 @@
+#include <Servo.h>
+
+uint8_t _servoPins[8] = {A8,A10,A12,A14,A9,A11,A13,A15};
+
+Servo servos[8] = {Servo(),Servo(),Servo(),Servo(),Servo(),Servo(),Servo(),Servo()};
+String received = "";
+int releaseAngle = 62;
+int holdAngle = 105;
+int actionTime = 250;
+int motionTime = 200;
+void setup() {
+  Serial.begin(115200);
+  Serial2.begin(115200);
+  delay(100);
+  enableServos();
+}
+void disableServos(){
+  for(uint8_t i=0;i<8;i++){
+    servos[i].detach();
+  }
+}
+void enableServos(){
+  for(uint8_t i=0;i<8;i++){
+    servos[i].attach(_servoPins[i]);
+    servos[i].write(i<4?90:releaseAngle);
+    delay(motionTime-100);
+  }
+  delay(motionTime);
+  servos[0].write(90);
+  delay(motionTime);
+  servos[1].write(90);
+  delay(motionTime);
+  servos[2].write(90);
+  delay(motionTime);
+  servos[3].write(90);
+  delay(motionTime);
+}
+void flipX(int dir){
+  releaseY();
+  delay(motionTime);
+  servos[1].write(0);
+  servos[3].write(180);
+  delay(motionTime+200);
+  holdX();
+  delay(motionTime);
+  if(dir==1){
+    servos[0].write(0);
+    servos[2].write(180);
+  }else{
+    servos[0].write(180);
+    servos[2].write(0);
+  }
+  delay(motionTime+200);
+  holdY();
+  delay(motionTime);
+  releaseX();
+  delay(motionTime);
+  servos[0].write(90);
+  servos[2].write(90);
+  delay(motionTime+200);
+  holdX();
+  delay(motionTime);
+  releaseY();
+  delay(motionTime);
+  servos[1].write(90);
+  servos[3].write(90);
+  delay(motionTime+200);
+  holdY();
+  delay(motionTime);
+}
+void holdX(){
+  servos[4].write(holdAngle-4);
+  servos[6].write(holdAngle+4);
+}
+void releaseX(){
+  servos[4].write(releaseAngle);
+  servos[6].write(releaseAngle);
+}
+
+void flipY(int dir){
+  releaseX();
+  delay(motionTime);
+  holdY();
+  delay(motionTime);
+  if(dir==1){
+    servos[1].write(0);
+    servos[3].write(180);
+  }else{
+    servos[1].write(180);
+    servos[3].write(0);
+  }
+  delay(motionTime+200);
+  holdX();
+  delay(motionTime);
+  releaseY();
+  delay(motionTime);
+  servos[1].write(90);
+  servos[3].write(90);
+  delay(motionTime+200);
+  holdY();
+  delay(motionTime);
+}
+void holdY(){
+  servos[5].write(holdAngle-4);
+  servos[7].write(holdAngle+4);
+}
+void releaseY(){
+  servos[5].write(releaseAngle);
+  servos[7].write(releaseAngle);
+}
+void rotateX(int dir,int face){
+  int count = dir>0?dir:-dir;
+  holdX();
+  delay(motionTime);
+  releaseY();
+  delay(motionTime);
+  servos[1].write(0);
+  servos[3].write(180);
+  delay(motionTime+100);
+  for(int i=0;i<count;i++){
+    holdY();
+    delay(motionTime);
+    servos[face==1?0:2].write(dir>0?180:0);
+    delay(motionTime+300);
+    servos[face==1?4:6].write(releaseAngle);
+    delay(motionTime+100);
+    servos[face==1?0:2].write(90);
+    delay(motionTime+100);
+    holdX();
+    delay(motionTime);
+  }
+  servos[face==1?0:2].write(dir>0?102:76);
+  delay(motionTime);
+  servos[face==1?0:2].write(90);
+  delay(motionTime);
+  releaseY();
+  delay(motionTime);
+  servos[1].write(90);
+  servos[3].write(90);
+  delay(motionTime);
+  holdY();
+  delay(motionTime);
+}
+void rotateY(int dir,int face){
+  int count = dir>0?dir:-dir;
+  holdX();
+  holdY();
+  delay(motionTime);
+  for(int i=0;i<count;i++){
+    servos[face==1?1:3].write(dir>0?180:0);
+    delay(motionTime+300);
+    servos[face==1?5:7].write(releaseAngle);
+    delay(motionTime+100);
+    servos[face==1?1:3].write(90);
+    delay(motionTime+300);
+    holdY();
+    delay(motionTime);
+  }
+  servos[face==1?1:3].write(dir>0?102:75);
+  delay(motionTime);
+  servos[face==1?1:3].write(90);
+  delay(motionTime);
+}
+void loop() {
+ if(Serial.available()){
+    char c = Serial.read();
+    if(c=='\n'){
+      parseCommand();
+      received="";
+    }else{
+      received+=c;
+    }
+  }
+}
+void parseCommand() {
+  received.toLowerCase();
+  char m_cmd = received.substring(0, 1).charAt(0);
+  int s_cmd = received.substring(1,2).toInt();
+  int v_cmd = received.substring(4).toInt();
+
+  if(m_cmd=='m'){
+    if(s_cmd==1){
+      int count = v_cmd>0?v_cmd:-v_cmd;
+      for(int i=0;i<count;i++){
+        flipX(v_cmd>0?1:-1);
+      }
+    }else if(s_cmd==2){
+      int count = v_cmd>0?v_cmd:-v_cmd;
+      for(int i=0;i<count;i++){
+        flipY(v_cmd>0?1:-1);
+      }
+    }else if(s_cmd==3){
+      v_cmd==1?holdX():holdY();
+    }else if(s_cmd==4){
+      v_cmd==1?releaseX():releaseY();
+    }else if(s_cmd==5){
+      rotateX(v_cmd,1);
+    }else if(s_cmd==6){
+      rotateX(v_cmd,-1);
+    }else if(s_cmd==7){
+      rotateY(v_cmd,1);
+    }else if(s_cmd==8){
+      rotateY(v_cmd,-1);
+    }
+  }
+  Serial.println("ok");
+}


getting the signing right … not

getting the signing right … not


hmm, restoring the register descriptions …