added Arduino sketch in its current state

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

--- sketch/meowshoes.ino
+++ sketch/meowshoes.ino
@@ -0,0 +1,121 @@
+  /*
+  Analog input, serial output
+
+  MEOW
+
+ */
+
+bool leftStand = true;
+bool rightStand = true;
+
+int pendingTapLeft = -1;
+int pendingTapRight = -1;
+int tapTimeoutLeftToe = 0;
+int tapTimeoutRightToe = 0;
+int tapTimeoutLeftHeel = 0;
+int tapTimeoutRightHeel = 0;
+
+int leftToeVal = 0;
+int leftHeelVal = 0;
+int rightToeVal = 0;
+int rightHeelVal = 0;
+
+// These constants won't change.  They're used to give names
+// to the pins used:
+const int leftToePin = 0;
+const int leftHeelPin = 1;
+const int rightToePin = 2;
+const int rightHeelPin = 3;
+const int tapTimeoutThresh = 30;
+
+void setup() {
+  // initialize serial communications at 9600 bps:
+  Serial.begin(9600);
+}
+
+void loop() {
+
+    // read *all* of the pins!
+    leftToeVal = analogRead(leftToePin);
+    leftHeelVal = analogRead(leftHeelPin);
+    rightToeVal = analogRead(rightToePin);
+    rightHeelVal = analogRead(rightHeelPin);
+
+    // if tap is already pending, and the tap lasted for at least 300 milliseconds
+    if ((pendingTapLeft != -1) && (tapTimeoutLeftToe >= tapTimeoutThresh)) {
+      // send tap
+      sendTap(pendingTapLeft);
+      pendingTapLeft = -1;
+      tapTimeoutLeftToe = 0;
+    }
+
+    // if tap is already pending, and the tap lasted for at least 300 milliseconds
+    if ((pendingTapLeft != -1) && (tapTimeoutLeftHeel >= tapTimeoutThresh)) {
+      // send tap
+      sendTap(pendingTapLeft);
+      pendingTapLeft = -1;
+      tapTimeoutLeftHeel = 0;
+    }
+
+     // if tap is already pending, and the tap lasted for at least 300 milliseconds
+    if ((pendingTapRight != -1) && (tapTimeoutRightToe >= tapTimeoutThresh)) {
+      // send tap
+      sendTap(pendingTapRight);
+      pendingTapRight = -1;
+      tapTimeoutRightToe = 0;
+    }
+
+    // if tap is already pending, and the tap lasted for at least 300 milliseconds
+    if ((pendingTapRight != -1) && (tapTimeoutRightHeel >= tapTimeoutThresh)) {
+      // send tap
+      sendTap(pendingTapRight);
+      pendingTapRight = -1;
+      tapTimeoutRightHeel = 0;
+    }
+
+    // if left toe is pressed, set pending tap and increment time tapped for
+    // make sure to check that heel is not also down, otherwise the user is standing/pausing
+    if (isPressed(leftToeVal) == true && isPressed(leftHeelVal) == false) {
+        pendingTapLeft = leftToePin;
+        tapTimeoutLeftToe++;
+
+     } else if (isPressed(leftHeelVal) == true && isPressed(leftToeVal) == false) {
+        pendingTapLeft = leftHeelPin;
+        tapTimeoutLeftHeel++;
+
+     } else if (isPressed(rightHeelVal) == true && isPressed(rightToeVal) == false) {
+        pendingTapRight = rightHeelPin;
+        tapTimeoutRightHeel++;
+
+     } else if (isPressed(rightToeVal) == true && isPressed(rightHeelVal) == false) {
+        pendingTapRight = rightToePin;
+        tapTimeoutRightToe++;
+
+
+     } else {
+      // their toe came back up
+       pendingTapLeft = -1;
+       tapTimeoutLeftToe = 0;
+       delay(10);
+    }
+
+  // wait 10 milliseconds before the next loop
+  // for the analog-to-digital converter to settle
+  // after the last reading:
+  delay(10);
+}
+
+// checks the sensor value
+bool isPressed(int val) {
+      if (val < 30) {
+        return true;
+      } else {
+        return false;
+      }
+}
+
+// prints the pin number to serial for javascript to pick up and use to play and sequence sounds
+void sendTap(int pinNo) {
+     Serial.println(pinNo);
+     delay(10);
+}


Added buggy SoundSensor

Added buggy SoundSensor

It’s buggy :-|

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


Add missing arduino code.

Add missing arduino code.

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

--- arduino/shooting_gallert_arduino_final_version.ino
+++ arduino/shooting_gallert_arduino_final_version.ino
@@ -0,0 +1,123 @@
+#include <Servo.h>
+
+#include <stdio.h>
+// Sweep
+// by BARRAGAN <http://barraganstudio.com>
+// This example code is in the public domain.
+
+int LIGHT_LEVEL = 140;
+int LIGHT_DELTA[4];
+int currentState[4];
+int average[4];
+int ledval[4];
+Servo servos[4];
+int SERVO_MIN[4];
+int SERVO_MAX[4];
+
+void setup() {
+  Serial.begin(9600);
+
+  //Setup Servo
+  servos[0].attach(3);
+  servos[1].attach(5);
+  servos[2].attach(6);
+  servos[3].attach(9);
+
+  average[0] = 130;
+  average[1] = 130;
+  average[2] = 280;
+  average[3] = 130;
+
+  SERVO_MIN[0] = 140;
+  SERVO_MAX[0] = 70;
+  SERVO_MIN[1] = 160;
+  SERVO_MAX[1] = 80;
+  SERVO_MIN[2] = 160;
+  SERVO_MAX[2] = 80;
+  SERVO_MIN[3] = 161;
+  SERVO_MAX[3] = 80;
+
+  LIGHT_DELTA[0] = 5;
+  LIGHT_DELTA[1] = 3;
+  LIGHT_DELTA[2] = 5;
+  LIGHT_DELTA[3] = 6;
+}
+
+void turnOnSensorAndSendValue(int sensor) {
+  int val = analogRead(sensor);
+//  Serial.println(val);
+
+ ledval[sensor] = val;
+//  val = constrain(val, 0, 92);
+//
+//  ledval[sensor] = map(val, 0, 92, 0, 255);
+
+  // Calculate delta to previous weighted average.
+  int delta = ledval[sensor] - average[sensor];
+
+  // Update weighted average.
+  average[sensor] = ((average[sensor] * 3) + ledval[sensor]) / 4;
+//
+//    Serial.print("average[sensor]: ");
+//    Serial.println(average[sensor]);
+   if(delta * delta > 9){
+//    Serial.print("delta: ");
+//    Serial.println(delta);
+   }
+
+  // CurrentState refers to light, has it been hit or not hit?
+  if ((!currentState[sensor] && delta > LIGHT_DELTA[sensor]) || (currentState[sensor] && delta < -LIGHT_DELTA[sensor])) {
+//    Serial.print("average[sensor]: ");
+//    Serial.println(average[sensor]);
+//    Serial.print("delta: ");
+//    Serial.println(delta);
+    currentState[sensor] = !currentState[sensor];
+    Serial.print(sensor);
+    Serial.print(currentState[sensor]);
+  }
+}
+
+void listenForServoInstructions() {
+  int servoNumber = 0;
+  int servoState = 0;
+  // send data only when you receive data:
+  if (Serial.available() > 0) {
+
+    // read the incoming byte:
+    servoNumber = Serial.read();
+    servoNumber -= '0';
+
+    // Blocking, waiting on the next input
+    while (Serial.available() == 0) {
+    }
+
+
+    servoState = Serial.read();
+    servoState -= '0';
+//        Serial.print("weve recieved servo info ");
+//        Serial.print(servoNumber);
+//        Serial.print(" ");
+//        Serial.println(servoState);
+    moveServo(servoNumber, servoState);
+    }
+}
+
+void moveServo(int servoNumber, int servoState) {
+   if (servoState == 1) {
+//     Serial.print("servo state 1");
+      servos[servoNumber].write(SERVO_MAX[servoNumber]);              // tell servo to go to position in variable 'pos'
+   } else {
+//          Serial.print("servo state 0");
+     servos[servoNumber].write(SERVO_MIN[servoNumber]);
+   }
+}
+
+void loop() {
+  listenForServoInstructions();
+  // Reset
+  for(int lightSensor = 0; lightSensor < 4; lightSensor += 1)  {
+   turnOnSensorAndSendValue(lightSensor);
+  }
+//turnOnSensorAndSendValue(0);
+  delay(10);
+}


more logging

more logging

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


import mfrc script

import mfrc script

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/bloc11/authsys-common.git/'


Initial commit

Initial commit

--- arduino-neopixel.ino
+++ arduino-neopixel.ino
@@ -0,0 +1,80 @@
+#include <Adafruit_NeoPixel.h>
+#define MAX_VAL 64  // 0 to 255 for brightness
+#define DELAY_TIME 50
+#define DELAY_TIME2 20
+
+// Parameter 1 = number of pixels in strip
+// Parameter 2 = pin number (most are valid)
+// Parameter 3 = pixel type flags, add together as needed:
+//   NEO_RGB     Pixels are wired for RGB bitstream
+//   NEO_GRB     Pixels are wired for GRB bitstream
+//   NEO_KHZ400  400 KHz bitstream (e.g. FLORA pixels)
+//   NEO_KHZ800  800 KHz bitstream (e.g. High Density LED strip)
+Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, 6, NEO_GRB + NEO_KHZ800);
+
+void setup() {
+  strip.begin();
+  strip.show(); // Initialize all pixels to 'off'
+}
+
+void loop() {
+  // Some example procedures showing how to display to the pixels:
+//    colorWipe(strip.Color(0, 0, 0), DELAY_TIME); // Black
+  colorWipe(strip.Color(MAX_VAL, 0, 0), DELAY_TIME); // Red
+  colorWipe(strip.Color(0, MAX_VAL, 0), DELAY_TIME); // Green
+  colorWipe(strip.Color(MAX_VAL, MAX_VAL, 0), DELAY_TIME); // Yellow
+  colorWipe(strip.Color(0, 0, MAX_VAL), DELAY_TIME); // Blue
+  colorWipe(strip.Color(MAX_VAL, 0, MAX_VAL), DELAY_TIME); // Purple
+  colorWipe(strip.Color(0, MAX_VAL, MAX_VAL), DELAY_TIME); // Cyan
+  colorWipe(strip.Color(MAX_VAL, MAX_VAL, MAX_VAL), DELAY_TIME); // White
+  rainbow(DELAY_TIME2);
+  rainbowCycle(DELAY_TIME2);
+}
+
+// Fill the dots one after the other with a color
+void colorWipe(uint32_t c, uint8_t wait) {
+  for(uint16_t i=0; i<strip.numPixels(); i++) {
+      strip.setPixelColor(i, c);
+      strip.show();
+      delay(wait);
+  }
+}
+
+void rainbow(uint8_t wait) {
+  uint16_t i, j;
+
+  for(j=0; j<256; j++) {
+    for(i=0; i<strip.numPixels(); i++) {
+      strip.setPixelColor(i, Wheel((i+j) & 255));
+    }
+    strip.show();
+    delay(wait);
+  }
+}
+
+// Slightly different, this makes the rainbow equally distributed throughout
+void rainbowCycle(uint8_t wait) {
+  uint16_t i, j;
+
+  for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel
+    for(i=0; i< strip.numPixels(); i++) {
+      strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
+    }
+    strip.show();
+    delay(wait);
+  }
+}
+
+// Input a value 0 to 255 to get a color value.
+// The colours are a transition r - g - b - back to r.
+uint32_t Wheel(byte WheelPos) {
+  if(WheelPos < 85) {
+   return strip.Color((WheelPos * 3)*MAX_VAL/255, (255 - WheelPos * 3)*MAX_VAL/255, 0);
+  } else if(WheelPos < 170) {
+   WheelPos -= 85;
+   return strip.Color((255 - WheelPos * 3)*MAX_VAL/255, 0, (WheelPos * 3)*MAX_VAL/255);
+  } else {
+   WheelPos -= 170;
+   return strip.Color(0, (WheelPos * 3)*MAX_VAL/255, (255 - WheelPos * 3)*MAX_VAL/255);
+  }
+}


Adding Arduino code for basic HTTP Authentication --- at line 80

error: pathspec 'Devices/Generic' did not match any file(s) known to git
error: pathspec 'HTTP' did not match any file(s) known to git
error: pathspec 'Device/ArduinoSample.ino' did not match any file(s) known to git


nIGHTLY

nIGHTLY

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/rniemand/ArduinoProjects.git/'


Created sketch

Created sketch

error: pathspec 'Prototypes/A7' did not match any file(s) known to git
error: pathspec 'Test/A7_Test/A7_Test.ino' did not match any file(s) known to git


New Wio Quickstart

New Wio Quickstart

error: pathspec 'wireless/quickstart/wio-gsm/Wio-2G-Quickstart.ino' did not match any file(s) known to git

--- wireless/quickstart/wio-gsm/Wio-2G-Quickstart.ino
+++ wireless/quickstart/wio-gsm/Wio-2G-Quickstart.ino
@@ -0,0 +1,77 @@
+#include "MC20_Common.h"
+#include "MC20_Arduino_Interface.h"
+#include "MC20_GPRS.h"
+GPRS gprs = GPRS();
+
+/*
+ * Setup variables for Twilio.
+ *
+ * The APN is fixed for Programmable Wireless.
+ * Feel free to change the URL and path.
+ */
+const char      APN[20]         = "wireless.twilio.com";
+const char      URL[100]        = "s3.amazonaws.com";
+char            path[100]       = \
+        "GET /com.twilio.prod.twilio-docs/quest/programmable_wireless/demo/basic-demo.html HTTP/1.0\n\r\n\r";
+
+/* No need to change HTTP port */
+int port = 80;
+
+/*
+ *  Function setup:
+ *    Setup runs automatically at powerup or reset. Will attempt to connect to
+ *    Programmable Wireless and retreive the web poage listed.
+ *
+ *    Inputs: None
+ *
+ *    Outputs: None
+ */
+void setup()
+{
+        int ret = 0;
+
+        /* Start Serial Output and GPRS */
+        SerialUSB.begin(115200);
+        gprs.Power_On();
+        SerialUSB.println("\n\rSerial working.");
+
+        if(!(ret = gprs.init(APN))) {
+                SerialUSB.print("Problem with GPRS init: ");
+                SerialUSB.println(ret);
+        }
+        gprs.join();
+
+        /* Print out IP data if successful */
+        SerialUSB.print("\n\rIP Address: ");
+        SerialUSB.print(gprs.ip_string);
+
+        /* Connect to host and path */
+        if(gprs.connectTCP(URL, port)) {
+                gprs.sendTCPData(path);
+        } else {
+                SerialUSB.println("Connection Error!");
+        }
+}
+
+/*
+ *  Function loop:
+ *    After setup() runs, this will loop continuously until the board is reset
+ *    or loses power.
+ *
+ *    Inputs: None
+ *
+ *    Outputs: None
+ */
+void loop()
+{
+        /* Write data out to the Serial port, if available. */
+        if(SerialUSB.available()){
+                serialMC20.write(SerialUSB.read());
+        }
+
+        if(serialMC20.available()){
+                SerialUSB.write(serialMC20.read());
+        }
+
+        /* Put your code here */
+}


Initial Arduino with Onboard Server for Choose_Video

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

--- pusher/choose_video.ino
+++ pusher/choose_video.ino
@@ -0,0 +1,172 @@
+#include <PusherClient.h>
+#include <Ethernet.h>
+#include <SPI.h>
+
+char subscribe[] = "choose_video";
+char receive_channel[] = "choose_video";
+String pusher_channel = "choose_video";
+String pusher_event_register = "arduino_event_register";
+String fact[] = {"a", "b","c", "JacobHanshaw"};
+int fact_delays[] = { 4000, 4000, 4000, 4000};
+int facts = 4;
+
+EthernetClient arisClient;
+PusherClient pusherClient;
+
+byte mac[] = {
+  0x90, 0xA2, 0xDA, 0x0C, 0x00, 0x83 };
+byte aris[] = {
+  50, 56, 80, 147 };
+
+const int relayPin1 = 2;
+const int relayPin2 = 3;
+const int video_over = 6;
+
+int video1Votes = 0;
+int video2Votes = 0;
+int members = 0;
+
+void setup() {
+  //Serial.begin(9600);
+  Serial.println("Setup...");
+  Ethernet.begin(mac); //,ip
+  delay(1000); //Give time to initialize before connecting
+
+  pinMode(relayPin1, OUTPUT);
+  pinMode(relayPin2, OUTPUT);
+  //pinMode(video_over, INPUT);
+
+  while(!pusherClient.connect("7fe26fe9f55d4b78ea02")){}
+  while(!pushMessage(pusher_channel, pusher_event_register, "success")) {}
+  pusherClient.bind("Member_Added", memberAdd);
+  pusherClient.bind("Member_Removed", memberRemove);
+  pusherClient.bind("Cast_Vote", eventHandler);
+  //  pusherClient.bindAll(eventHandler);
+  //  pusherClient.bind(subscribe, eventHandler);
+  pusherClient.subscribe(receive_channel);
+  Serial.println("Pusher Connect Success!");
+}
+
+
+void loop() {
+  pusherClient.monitor();
+  if(members > 0){
+    //Begin the login time
+    long startTime = millis();
+    while((millis() -startTime) <= 15000){
+      pusherClient.monitor();
+      int time = (millis()-startTime);
+      if(time % 1000 <= 10){
+        String output = (String)time;
+        while(!pushMessage(pusher_channel, "Clock_Time", output)) { }
+      }
+    }
+    //Begin Voting
+    while(!pushMessage(pusher_channel, "Begin_Voting", "")) { }
+    startTime = millis();
+    while((millis() -startTime) <= 30000 && members != (video1Votes + video2Votes)){
+      pusherClient.monitor();
+    }
+    //Voting Complete, trigger the pin
+    if(video1Votes >= video2Votes){
+      digitalWrite(relayPin1, HIGH);
+      delay(500);
+      digitalWrite(relayPin1, LOW);
+      Serial.println("Video 1 Wins!");
+    }
+    else{
+      digitalWrite(relayPin2, HIGH);
+      delay(500);
+      digitalWrite(relayPin2, LOW);
+      Serial.println("Video 2 Wins!");
+    }
+    video1Votes = 0;
+    video2Votes = 0;
+
+    //Tell clients, Voting is complete
+    while(!pushMessage(pusher_channel, "Done_Voting", "")) {
+    }
+    delay(2000);
+    for(int i = 0; i < facts; i++){
+       while(!pushMessage(pusher_channel, "Message", fact[i])) { }
+       delay(fact_delays[i]);
+    }
+    //while(digitalRead(video_over) == LOW) { }
+    while(!pushMessage(pusher_channel, "Video_Over", "")) {
+    }
+  }
+}
+
+void memberAdd(String data) {
+  members++;
+ // Serial.println("Members: ");
+ // Serial.println(members);
+}
+
+void memberRemove(String data) {
+  if(members-1>=0){
+    members--;
+  }
+//  Serial.println("Members: ");
+//  Serial.println(members);
+}
+
+void eventHandler(String data) {
+  //Serial.println(data);
+  int firstColon = data.indexOf(':');
+  int secondColon = data.indexOf(':', firstColon + 1 );
+  int start = secondColon + 4;
+  int endQuote = data.indexOf('"', start);
+  int endofData = endQuote -1;
+  String importantData = data.substring(start, endofData);
+ // Serial.println(importantData);
+  if(importantData.charAt(0) == 'v'){
+    importantData = importantData.substring(1);
+    char pointer[importantData.length()];
+    for(int i = 0; i < importantData.length(); i++){
+      pointer[i] = importantData.charAt(i);
+    }
+    int vote = atoi(pointer);
+    if(vote == 1){
+    //  Serial.println("1");
+      video1Votes++;
+      String votes = (String)video1Votes;
+      votes += "^";
+      votes += video2Votes;
+      Serial.println(votes);
+      while(!pushMessage(pusher_channel, "Vote", votes)) {
+      }
+    }
+    else if(vote == 2){
+  //    Serial.println("2");
+      video2Votes++;
+      String votes = (String)video1Votes;
+      votes += "^";
+      votes += video2Votes;
+      Serial.println(votes);
+      while(!pushMessage(pusher_channel, "Vote", votes)) {
+      }
+    }
+  }
+  else{
+  //  Serial.println("ERROR: " + data);
+  }
+}
+
+boolean pushMessage(String channel, String event, String data){
+  if(arisClient.connect(aris, 80)){
+    String request = "GET /server/pusher/public_send.php?channel="; //change when updated
+    request += channel;
+    request += "&event=";
+    request += event;
+    request += "&data=";
+    request += data;
+    request += " HTTP/1.0";
+    arisClient.println(request);
+    arisClient.println();
+    arisClient.stop();
+    return true;
+  }
+  return false;
+}
+


Bluetooth Code⻘🔷

Bluetooth Code⻘🔷

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

--- bluetooth/bluetooth.ino
+++ bluetooth/bluetooth.ino
@@ -0,0 +1,24 @@
+#include <SoftwareSerial.h>
+
+SoftwareSerial BTSerial(10, 11); // RX | TX
+
+void setup()
+{
+  pinMode(9, OUTPUT);  // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode
+  digitalWrite(9, HIGH);
+  Serial.begin(9600);
+  Serial.println("Enter AT commands:");
+  BTSerial.begin(38400);  // HC-05 default speed in AT command more
+}
+
+void loop()
+{
+
+  // Keep reading from HC-05 and send to Arduino Serial Monitor
+  if (BTSerial.available())
+    Serial.write(BTSerial.read());
+
+  // Keep reading from Arduino Serial Monitor and send to HC-05
+  if (Serial.available())
+    BTSerial.write(Serial.read());
+}


Got it to compile!

Got it to compile!

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


add relay_led

add relay_led

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

--- relay_led/relay_led.ino
+++ relay_led/relay_led.ino
@@ -0,0 +1,18 @@
+// demo of relay control led
+// relay connect to D2
+
+const int pinRelay = 2;
+
+void setup()
+{
+	pinMode(pinRelay, OUTPUT);
+	digitalWrite(pinRelay, LOW);
+}
+
+void loop()
+{
+	digitalWrite(pinRelay, HIGH);				// led on
+	delay(1000);								// delay 1s
+	digitalWrite(pinRelay, LOW);				// led off
+	delay(1000);								// delay 1s
+}


initial velocity commit, just for the tests, not working yet

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

--- example/Velocity/Velocity.ino
+++ example/Velocity/Velocity.ino
@@ -0,0 +1,94 @@
+#include "LidarObject.h"
+#include "LidarController.h"
+#include "I2CFunctions.h"
+
+#include <Wire.h>
+#define WIRE400K false
+/*** Defines : CONFIGURATION ***/
+// Defines Trigger
+#define Z1_LASER_TRIG 11
+#define Z2_LASER_TRIG 8
+#define Z3_LASER_TRIG 5
+#define Z4_LASER_TRIG 2
+#define Z5_LASER_TRIG 16
+#define Z6_LASER_TRIG 19
+// Defines power enable lines of laser
+#define Z1_LASER_EN 12
+#define Z2_LASER_EN 9
+#define Z3_LASER_EN 6
+#define Z4_LASER_EN 3
+#define Z5_LASER_EN 15
+#define Z6_LASER_EN 18
+// Defines laser mode
+#define Z1_LASER_PIN 13
+#define Z2_LASER_PIN 10
+#define Z3_LASER_PIN 7
+#define Z4_LASER_PIN 4
+#define Z5_LASER_PIN 14
+#define Z6_LASER_PIN 17
+//Define address of lasers
+//Thoses are written during initialisation
+// default address : 0x62
+#define Z1_LASER_AD 0x6E
+#define Z2_LASER_AD 0x66
+#define Z3_LASER_AD 0x68
+#define Z4_LASER_AD 0x6A
+#define Z5_LASER_AD 0x6C
+#define Z6_LASER_AD 0x64
+
+#define NUMBER_OF_LASERS 2
+
+// Maximum datarate
+#define DATARATE 20
+// Actual wait between communications 100Hz = 10ms
+#define DELAY_SEND_MICROS 1000000/DATARATE
+
+// Lidars
+static LidarController Controller;
+static LidarObject LZ1;
+static LidarObject LZ2;
+
+// Delays
+long now, last;
+
+void beginLidars() {
+  // Initialisation of the lidars objects
+  LZ1.begin(Z1_LASER_EN, Z1_LASER_PIN, Z1_LASER_AD, 2, 'x');
+  LZ2.begin(Z2_LASER_EN, Z2_LASER_PIN, Z2_LASER_AD, 2, 'X');
+
+  // Initialisation of the controller
+  Controller.begin(WIRE400K);
+  delay(100);
+  Controller.add(&LZ1, 0);
+  Controller.add(&LZ2, 1);
+}
+
+void setup() {
+  Serial.begin(57600);
+  while (!Serial);
+  beginLidars();
+  last = micros();
+}
+
+void loop() {
+  Controller.spinOnce();
+  now = micros();
+  if(now - last > DELAY_SEND_MICROS){
+    last = micros();
+    laserprint();
+  }
+}
+
+void laserprint(){
+  for(byte i = 0; i < NUMBER_OF_LASERS; i++){
+    Serial.print(i);
+    Serial.print("\t");
+    Serial.print(Controller.distances[i]);
+    Serial.print("\t");
+    Serial.print(Controller.statuses[i]);
+    Serial.print("\t");
+    Serial.print(Controller.signal_strengths[i]);
+    Serial.print("\t");
+  }
+  Serial.println("");
+}


New Packet reading file

New Packet reading file

Not the one Jens put up, but trying to understand it from scratch

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

--- Xbee_work_in_progress/Xbee_work_in_progress.ino
+++ Xbee_work_in_progress/Xbee_work_in_progress.ino
@@ -0,0 +1,101 @@
+/*
+   Format for XBEE packets
+    0 0x7e  - start ch
+    1 0x00  - length msb
+    2 0x14  - length lsb
+    3 0x83  - API frame identifier
+    4 0x56  - senders address
+    5 0x78  - senders address
+    6 0x43  - received signal strength - RSI
+    7 0x00  - option byte
+    8 0x01  - nu,mber of samples
+    9 0x3e  - channel indicator mask n/a A5 A4 A3 A2 A1 A0 D8
+   10 0xe0  - channel indicatot mask  D7 D6 D5 D4 D3 D2 D1 D0
+   11 0x00  - digital sample (msb)
+   12 0x40  - digital sample (lsb)
+
+   13 0x??  - Acc Z (msb)
+   14 0x??  - Acc Z (lsb)
+
+   15 0x??  - Acc Y (msb)
+   16 0x??  - Acc Y (lsb)
+
+   17 0x??  - Acc X (msb)
+   18 0x??  - Acc X (lsb)
+
+   19 0x??  - EMG ch1 (msb)
+   20 0x??  - EMG ch1 (lsb)
+
+   21 0x??  - EMG ch2 (msb)
+   22 0x??  - EMG ch2 (lsb)
+
+   23 0x??  - checksum
+
+   The checksum is all bytes added together excl the first three. The sum including(!) the checksum shall give 0xff
+   Strategy sum all bytes excluding first three. The checksum will be 0xff - sum
+*/
+char testPkg[24] = {0x7e, 0x00, 0x14, 0x83, 0x56, 0x78, 0x43, 0x00, 0x01, 0x3e,
+                    0xe0, 0x00, 0x40, 0x02, 0x9b, 0x02, 0x1a, 0x02, 0x05, 0x00,
+                    0x00, 0x00, 0x05, 0x47};  // from datasheet
+
+char hexTable[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
+
+
+void setup() {
+  Serial.begin(115200);
+  while (! Serial) // wait until serial port is up and running
+  { }
+
+  delay(500); // just to be sure
+}
+
+char chksum(char *pk, int lgt)
+{
+  char s = 0;
+  for (int i = 0; i < lgt; i++)
+    s += *(pk + i);
+  return s;
+}
+
+void getPkg(char *package){
+  int counter = 0;
+  char temp;
+    do{
+      if(Serial.available()){
+        temp = Serial.read(); // reads the first element in serial buffer
+          if(temp == 0x7e){
+            package[counter] = temp;
+            counter++;
+            }
+      }
+    }while(counter == 0);
+    do{
+      if(Serial.available()){
+        temp = Serial.read();
+        package[counter] = temp;
+        counter++;
+      }
+
+    }while(counter < 24);
+
+  }
+
+int checksumPkg(char *package){
+  char sum;
+  for(int i = 3; i < 24; i++){
+    sum = sum + package[i];
+  }
+  if(sum == 0x47){ //Check with the checksum of the package
+    return 0; // ok, good package
+  }
+  else{
+    return -1; // error
+  }
+}
+
+
+
+
+void loop() {
+  delay(5000);
+}


Auto tank filler

Auto tank filler

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

--- arduino/arduino.ino
+++ arduino/arduino.ino
@@ -0,0 +1,74 @@
+/**
+ * Senseo coffee maker by Equisense.
+ *
+ * By Kamel Tighidet <kamel@equisense.fr>
+ * and Yoan Tournade <yoan@ytotech.com>
+ */
+
+// We set the push delay
+// (delay between the high and low signal to simulate a push button action).
+int PUSH_BTN_DELAY = 500;
+// Wired to the Senseo Power push button.
+int PIN_POWER = 2;
+// Wired to the Senseo Short Coffee push button.
+// If we put that to high it make a short coffee: obvious man being obvious here.
+int PIN_MAKE_SHORT = 3;
+// Wired to the Senseo Long Coffee push button.
+int PIN_MAKE_LONG = 4;
+// Wired to the RPi, so it can order a short coffee.
+int PIN_ORDER_SHORT = 5;
+// Wired to the RPi, so it can order a short coffee.
+int PIN_ORDER_LONG = 6;
+// Wired to the moisture sensor (to sense the water level)
+int PIN_MOISTURE_SENSOR = 7;
+// Wired the the relay (to activate the water pump)
+int PIN_WATER_PUMP_RELAY = 8;
+int is_short_ordered;
+int is_long_ordered;
+int is_tank_not_full;
+
+void setup() {
+  Serial.begin(9600);
+  // We init the in/out pins
+  pinMode(PIN_POWER, OUTPUT);
+  digitalWrite(PIN_POWER, HIGH);
+  pinMode(PIN_MAKE_SHORT, OUTPUT);
+  digitalWrite(PIN_MAKE_SHORT, HIGH);
+  pinMode(PIN_MAKE_LONG, OUTPUT);
+  digitalWrite(PIN_MAKE_LONG, HIGH);
+  pinMode(PIN_ORDER_SHORT, INPUT);
+  pinMode(PIN_ORDER_LONG, INPUT);
+  pinMode(PIN_WATER_PUMP_RELAY, OUTPUT);
+  pinMode(PIN_MOISTURE_SENSOR, INPUT);
+}
+
+void loop() {
+  is_tank_not_full = digitalRead(PIN_MOISTURE_SENSOR);
+  if(is_tank_not_full){
+    Serial.println("Tank not full. Activating water pump");
+  }
+  digitalWrite(PIN_WATER_PUMP_RELAY, is_tank_not_full);
+  is_short_ordered = digitalRead(PIN_ORDER_SHORT);
+  is_long_ordered = digitalRead(PIN_ORDER_LONG);
+  if((is_short_ordered || is_long_ordered) && !is_tank_not_full) {
+    Serial.println("Powering the Senseo machine");
+    digitalWrite(PIN_POWER, LOW);
+    delay(PUSH_BTN_DELAY);
+    digitalWrite(PIN_POWER, HIGH);
+    delay(10000);
+    if(is_short_ordered) {
+      Serial.println("Start a short coffee");
+      digitalWrite(PIN_MAKE_SHORT, LOW);
+      delay(PUSH_BTN_DELAY);
+      digitalWrite(PIN_MAKE_SHORT, HIGH);
+    } else {
+      Serial.println("Start a long coffeee");
+      digitalWrite(PIN_MAKE_LONG, LOW);
+      delay(PUSH_BTN_DELAY);
+      digitalWrite(PIN_MAKE_LONG, HIGH);
+    }
+    Serial.println("Wait for the coffee to be ready");
+    delay(30000);
+  }
+}
+


Initial code import

Initial code import

--- autotop986.ino
+++ autotop986.ino
@@ -0,0 +1,155 @@
+/*
+  986 Auto-Top by Alex Roy
+  This auto-presses the open or close buttons for the convertible top on a Porsche 986
+  for the specified open/close seconds automatically if you quickly tap the button.
+  If the button tap is longer (eg it is held down), the button is only autp-pressed
+  for the same amount of time as the user is pressing.
+
+  If the top is already automatically opening or closing, a second press of either
+  button cancels the auto-open proceedure.
+
+  My 2001 Boxster S open/close timing:
+  13.6sec to open
+  14.4sec to close
+ */
+
+ #define openBtnOut     2
+ #define closeBtnOut    3
+ #define pBrakeOut      4
+ #define openBtnIn      8
+ #define closeBtnIn     9
+
+ int movementCount = 0;
+ int openBtnCount = 0;
+ int closeBtnCount = 0;
+ int openMode = 0; //0=no auto movement, 1=auto open, 2 = auto close, 3 = manual open, 4 = manual close
+ bool btnReleased = false;
+ bool ignoreBtn = false;
+
+ #define shortPressInterval 250
+ #define loopInterval 50
+
+ #define openTime 15600
+ #define closeTime 16400
+
+ void setup() {
+   pinMode(openBtnOut, OUTPUT);
+   pinMode(closeBtnOut, OUTPUT);
+   pinMode(pBrakeOut, OUTPUT);
+
+   pinMode(openBtnIn, INPUT);
+   pinMode(closeBtnIn, INPUT);
+
+   allStop();
+ }
+
+ void loop() {
+   //check buttons
+   if(digitalRead(openBtnIn) == HIGH) {
+     if(btnReleased){
+       allStop();
+       ignoreBtn = true;
+     } else if(ignoreBtn == false) {
+       if(openBtnCount < 32000) {
+         openBtnCount += loopInterval;
+       }
+       closeBtnCount = 0;
+       digitalWrite(closeBtnOut, LOW);
+     }
+   } else if(digitalRead(closeBtnIn) == HIGH) {
+     if(btnReleased){
+       allStop();
+       ignoreBtn = true;
+     } else if(ignoreBtn == false) {
+       if(closeBtnCount < 32000) {
+         closeBtnCount += loopInterval;
+       }
+       openBtnCount = 0;
+       digitalWrite(openBtnOut, LOW);
+     }
+   } else if (openMode != 1 && openMode != 2) {
+     allStop();
+     ignoreBtn = false;
+   } else {
+     btnReleased = true;
+     ignoreBtn = false;
+   }
+
+   switch(openMode) { ////0=no auto movement, 1=auto open, 2 = auto close, 3 = manual open, 4 = manual close
+     case 1: //currently auto-opening
+       movementCount -= loopInterval;
+       if(openBtnCount > shortPressInterval) { //if the interval is greater, transition to manual open mode
+         openMode = 3;
+       } else { //continue with auto-open
+         if(movementCount <= 0 || closeBtnCount > 0) { //stop auto-open function
+           allStop();
+         } else { //continue with auto-open function
+           //continue with current pin state
+         }
+       }
+       break;
+
+     case 2: //currently auto-closing
+       movementCount -= loopInterval;
+       if(closeBtnCount > shortPressInterval) { //if the interval is greater, transition to manual close mode
+         openMode = 4;
+       } else { //continue with auto-close
+         if(movementCount <= 0 || openBtnCount > 0) { //stop auto-open function
+           allStop();
+         } else { //continue with auto-close function
+           //continue with current pin state
+         }
+       }
+       break;
+
+     case 3: //currently manually opening
+       movementCount = 0;
+       if(openBtnCount > 0) {
+         //continue with current pin state
+       } else {
+         allStop();
+       }
+       break;
+
+     case 4: //currently manually closing
+       movementCount = 0;
+       if(closeBtnCount > 0) {
+         //continue with current pin state
+       } else {
+         allStop();
+       }
+       break;
+
+     default: //no movement currently
+       if(openBtnCount > 0) {
+         openMode = 1;
+         movementCount = openTime;
+         digitalWrite(pBrakeOut, HIGH);
+         digitalWrite(closeBtnOut, LOW);
+         digitalWrite(openBtnOut, HIGH);
+       } else if(closeBtnCount > 0) {
+         openMode = 2;
+         movementCount = closeTime;
+         digitalWrite(pBrakeOut, HIGH);
+         digitalWrite(openBtnOut, LOW);
+         digitalWrite(closeBtnOut, HIGH);
+       } else {
+         allStop();
+       }
+
+       break;
+   }
+
+   delay(loopInterval);
+ }
+
+ void allStop() {
+   digitalWrite(openBtnOut, LOW);
+   digitalWrite(closeBtnOut, LOW);
+   digitalWrite(pBrakeOut, LOW);
+   openMode = 0;
+   movementCount = 0;
+   openBtnCount = 0;
+   closeBtnCount = 0;
+   btnReleased = false;
+ }


Add first version of arduino sketch

Add first version of arduino sketch

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

--- oled_display/oled_display.ino
+++ oled_display/oled_display.ino
@@ -0,0 +1,162 @@
+#include "U8glib.h"
+U8GLIB_SSD1306_132X64 u8g(10, 9, 12, 11, 8);
+//                        D0, D1,CS, DC, RST
+
+String string_buffer[7];
+uint8_t matrix[16*64]; // 16*8 pixels per row, 64 rows
+const int max_input = 128;
+char input_buffer[max_input];
+
+void u8g_prepare(void) {
+	u8g.begin();
+	u8g.setFont(u8g_font_lucasfont_alternate);
+	u8g.setFontRefHeightExtendedText();
+	u8g.setDefaultForegroundColor();
+	u8g.setFontPosTop();
+}
+
+void clear_screen() {
+	for (int i=0; i<7; i++){
+		string_buffer[i] = String("");
+	}
+
+	for(int i=0; i<(16*64); i++) {
+		matrix[i] = 0;
+	}
+}
+
+void buffer_line(String new_string, int line) {
+	// Buffer a line. Can either scroll existing lines if called with line == -1
+	// or set a specific line.
+
+	if (line == -1) {
+		for (int i=1; i<7; i++){
+			string_buffer[i-1] = string_buffer[i];
+		}
+		string_buffer[6] = new_string;
+	} else {
+		string_buffer[line] = new_string;
+	}
+}
+
+void buffer_line(String new_string) {
+	buffer_line(new_string, -1);
+}
+
+void scroll_text(String input){
+	// Scrolls existing text content up, adding new lines at the bottom.
+	// A single string is passed in, which is split into several lines if it's too long.
+
+	String part = input;
+	int length = 1;
+	int start_pos = 0;
+	int font_width = 0;
+
+	while (true) {
+		char char_buf[length+1];
+		part.toCharArray(char_buf, length+1);
+		font_width = u8g.getStrWidth(char_buf);
+
+		if (length < part.length() && font_width < 123) {
+			length += 1;
+		} else {
+			start_pos = start_pos + length;
+			buffer_line(char_buf);
+
+			part = input.substring(start_pos);
+			length = 1;
+		}
+		if (!part.length()){
+			break;
+		}
+	}
+}
+
+void handle_command(char *command, int length) {
+	switch(command[0]) {
+		case 'C':
+			clear_screen();
+			break;
+		case 'U':
+			draw_screen();
+			break;
+		case 'S':
+			// Normal string. Simply scroll text
+			scroll_text(String(command + 1));
+			break;
+		case 'L':
+			// Specific line. arg: line number
+			Serial.println(command[1], DEC);
+			Serial.println(command[1]-'0', DEC);
+			buffer_line(String(command + 2), command[1] - '0');
+			break;
+		case 'P':
+			// Pixel data. Format is X, Y, 1/0, X, Y 1/0, ...
+			// For example: P001101201301401501...
+			// Note that here we're using byte values, not encoded strings.
+			int data_len = length - 1;
+			if (data_len % 3) {
+				Serial.print("ERROR: Pixel data was of unexpected length ");
+				Serial.println(data_len);
+			} else {
+				int matrix_index;
+				byte matrix_bit;
+				byte x;
+				byte y;
+				byte color;
+
+				for(int i=1; i <= data_len-2; i+=3) {
+					x = command[i];
+					y = command[i+1];
+					color = command[i+2];
+
+					matrix_index = (x / 8) + 16*y;
+					matrix_bit = 7 - x % 8;
+
+					if(color) {
+						bitSet(matrix[matrix_index], matrix_bit);
+					} else {
+						bitClear(matrix[matrix_index], matrix_bit);
+					}
+				}
+			}
+			break;
+	}
+}
+
+void draw_screen() {
+	u8g.firstPage();
+	u8g.setColorIndex(1);
+	do {
+		u8g.drawBitmap(0, 0, 16, 64, matrix);
+
+		for (int i=0; i<7; i++){
+			char tmp[50];
+			string_buffer[i].toCharArray(tmp, 50);
+			int font_width = u8g.getStrWidth(tmp);
+			u8g.drawStr(max(0, 64-font_width/2), i*9-1, tmp);
+		}
+	} while(u8g.nextPage());
+}
+
+void setup(void) {
+	Serial.begin(9600);
+	u8g_prepare();
+	clear_screen();
+	draw_screen();
+}
+
+void loop(void) {
+	if (Serial.available()) {
+		int bytes = Serial.readBytesUntil(0x7f, input_buffer, max_input);
+		input_buffer[bytes] = 0;
+		handle_command(input_buffer, bytes);
+		Serial.println("ok");
+	}
+
+	// Wait for data
+	while(!Serial.available()) {
+	}
+}
+
+


Create canRPM.ino

Create canRPM.ino

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

--- canRPM/src/canRPM.ino
+++ canRPM/src/canRPM.ino
@@ -0,0 +1,142 @@
+/*
+ canRPM
+
+ created 11JUL2016
+ by Kirk Terrell
+
+  This example is based off an example code from Arduino's site
+ http://arduino.cc/en/Tutorial/Datalogger and it shows how to
+ log data from three analog sensors with a timestamp based on when
+ the Arduino began running the current program to an SD card using
+ the SD library https://github.com/greiman/SdFat by William
+ Greiman. This example code also includes an output to the
+ Serial Monitor for debugging.
+
+
+ This example code is in the public domain.
+ */
+
+
+#include <SPI.h>
+#include <SD.h>
+
+#include "Canbus.h"
+#include "mcp2515.h"
+#include "canbuster.h"
+
+
+
+char buffer[456];  //Data will be temporarily stored to this buffer before being written to the file
+tCAN message;
+File dataFile;
+unsigned long timeStamp,now;
+
+// Chip Select pin is tied to pin 9 on the SparkFun CAN-Bus Shield
+const int chipSelect = 9;
+
+void writeFile(tCAN message, char buffer[456]) {
+
+
+
+
+    File dataFile = SD.open("RPM/LOG.TXT", FILE_WRITE);  //Create directory
+
+
+    //write to uSD card
+    dataFile.print(millis());
+    dataFile.print(", ");
+    dataFile.print(buffer);
+    dataFile.print(", ");
+    dataFile.print(message.id,HEX);
+    dataFile.print(", ");
+    for (int i=0;i<8;i++) {
+        dataFile.print(message.data[i],DEC);
+        if ( i < 7) dataFile.print(", ");
+
+        }
+    dataFile.println();
+    delay(10);
+    dataFile.close();   //close file
+    return;
+}
+
+void setup()
+{
+  // Open serial communications and wait for port to open:
+  Serial.begin(9600);
+  while (!Serial) {
+    ; // wait for serial port to connect. Needed for Leonardo only
+  }
+
+  Serial.print("Initializing SD card...");
+  // make sure that the default chip select pin is set to
+  // output, even if you don't use it:
+  pinMode(chipSelect, OUTPUT);
+
+  // see if the card is present and can be initialized:
+  if (!SD.begin(chipSelect)) {
+    Serial.println("Card failed, or not present");
+    // don't do anything more:
+    return;
+  }
+
+  Serial.println("card initialized.");
+  SD.mkdir("RPM");
+  File dataFile = SD.open("RPM/LOG.TXT", FILE_WRITE);  //Create directory
+  dataFile.println("Time, RPM, AID, D0,D1,D2,D3,D4,D5,D6,D7");
+  dataFile.close();
+  if(Canbus.init(CANSPEED_500))  /* Initialise MCP2515 CAN controller at the specified speed */
+  {
+    Serial.println("CAN Init ok");
+  } else
+  {
+    Serial.println("Can't init CAN");
+  }
+
+  while (!mcp2515_check_message()){
+    delay(100);
+  }
+  Serial.println("CAN traffic detected");
+  delay(5000);
+  Serial.println("Rev engine higher and lower");
+}
+
+void loop()
+{
+
+
+        Canbus.ecu_req(ENGINE_RPM, buffer);
+        while (buffer[0]=='0') {
+            Canbus.ecu_req(ENGINE_RPM, buffer);
+
+        }
+
+        if (mcp2515_check_message()) {
+
+	        if (mcp2515_get_message(&message)) {
+
+			    switch (message.id) {
+			        case ecuBRAKE01:        //Ignore message from this ECU
+			            break;
+			        case ecuBRAKE02:        //Ignore message from this ECU
+			            break;
+			        case ecuSTEER01:        //Ignore message from this ECU
+			            break;
+			        case 0x7E8:             //Ignore message from this ECU
+			            break;
+			        default:
+			            writeFile(message,buffer);
+			            break;
+                }
+
+
+
+                	}
+                }
+
+
+
+
+
+
+}


Created example to control a tank with the Sphero IMU
*Uses Sabertooth Arduino Library*

Signed-off-by: Cruz Monrreal II <663375bc5b4c6ed13a95cc63b2dd9f1e16363f4e@gmail.com>

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

--- examples/SpheroTankControl/SpheroTankControl.ino
+++ examples/SpheroTankControl/SpheroTankControl.ino
@@ -0,0 +1,54 @@
+/************************************************
+ Written by Cruz Monrreal II
+ Created on 08-19-2012
+ Modified on 10-20-2012
+
+ Updates can be found here:
+  https://github.com/cmonr/Arduino-Sphero-Library
+************************************************/
+
+#include <Sphero.h>
+#include <SabertoothSimplified.h>
+
+Sphero sphero;
+SabertoothSimplified ST;
+
+void setup() {
+  Serial.begin(9600);
+  ST.drive(0);
+  ST.turn(0);
+
+  // Indicator LED
+  sphero.setBackLED(0xFF);
+
+  // Lock motors
+  sphero.setStabilization(0);
+
+  // Init Heading to 0
+  sphero.setHeading(0x00);
+
+  // Get Pitch @ 5Hz
+  sphero.setStreamingData(10, 1, SPHERO_IMU_PITCH | SPHERO_IMU_YAW);
+}
+
+void loop() {
+  signed short pitch, yaw;
+  sphero.readAsyncPacket();
+
+  pitch = sphero.getData(0) << 8 | sphero.getData(1);
+  yaw = sphero.getData(2) << 8 | sphero.getData(3);
+
+  if (yaw < -70 && yaw > -140){
+    ST.turn(-50);
+  }else if (yaw > 70 && yaw < 140){
+    ST.turn(50);
+  }else if (pitch < -50){
+    ST.drive(-50);
+    //ST.turn(0);
+  }else if (pitch > 50){
+    ST.drive(50);
+  }else{
+    ST.drive(0);
+    ST.turn(0);
+  }
+}


Changed the name of the sketch

Changed the name of the sketch

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

--- Smoker_Controller.ino
+++ Smoker_Controller.ino
@@ -0,0 +1,266 @@
+
+
+/***************************************************
+  This is an example for the Adafruit Thermocouple Sensor w/MAX31855K
+
+  Designed specifically to work with the Adafruit Thermocouple Sensor
+  ----> https://www.adafruit.com/products/269
+
+  These displays use SPI to communicate, 3 pins are required to
+  interface
+  Adafruit invests time and resources providing this open source code,
+  please support Adafruit and open-source hardware by purchasing
+  products from Adafruit!
+
+  Written by Limor Fried/Ladyada for Adafruit Industries.
+  BSD license, all text above must be included in any redistribution
+ ****************************************************/
+
+#include <SPI.h>
+#include "Adafruit_MAX31855.h"
+#include <Bridge.h>
+#include <Console.h>
+#include <PID_AutoTune_v0.h>
+#include <PID_v1.h>
+
+// So we can save and retrieve settings
+#include <EEPROM.h>
+
+// IO Pins for thermocouple
+#define DO   3
+#define CS   4
+#define CLK  5
+//Keys for the Bridge interface
+#define DEGF "degF"
+#define DEGC "degC"
+#define TARGEF "targetF"
+
+#define KP "kp"
+#define SP "sp"
+#define KI "ki"
+#define KD "kd"
+// Output Relay
+#define RelayPin 7
+
+// ************************************************
+// PID Variables and constants
+// ************************************************
+
+//Define Variables we'll be connecting to
+double Setpoint;
+double Input;
+double Output;
+
+volatile long onTime = 0;
+
+// pid tuning parameters
+double Kp;
+double Ki;
+double Kd;
+
+// EEPROM addresses for persisted data
+const int SpAddress = 0;
+const int KpAddress = 8;
+const int KiAddress = 16;
+const int KdAddress = 24;
+
+Adafruit_MAX31855 thermocouple(CLK, CS, DO);
+//Specify the links and initial tuning parameters
+PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);
+
+// 10 second Time Proportional Output window
+int WindowSize = 10000;
+unsigned long windowStartTime;
+
+// ************************************************
+// Auto Tune Variables and constants
+// ************************************************
+byte ATuneModeRemember=2;
+
+double aTuneStep=500;
+double aTuneNoise=1;
+unsigned int aTuneLookBack=20;
+
+boolean tuning = false;
+
+PID_ATune aTune(&Input, &Output);
+
+const int logInterval = 10000; // log every 10 seconds
+long lastLogTime = 0;
+
+// ************************************************
+// States for state machine
+// ************************************************
+enum operatingState { OFF = 0, SETP, RUN, TUNE_P, TUNE_I, TUNE_D, AUTO};
+operatingState opState = OFF;
+
+String setTemp = "";
+
+void setup() {
+  Bridge.begin();
+  Console.begin();
+  // Initialize Relay Control:
+  pinMode(RelayPin, OUTPUT);    // Output mode to drive relay
+  digitalWrite(RelayPin, LOW);  // make sure it is off to start
+
+  // Initialize the PID and related variables
+  LoadParameters();
+
+  // wait for MAX chip to stabilize
+  delay(500);
+  //Timer code, not sure if need
+  // Run timer2 interrupt every 15 ms
+  //TCCR4A = 0;
+  //TCCR4B = 1<<CS42 | 1<<CS41 | 1<<CS40;
+
+  //Timer2 Overflow Interrupt Enable
+  //TIMSK4 |= 1<<TOIE4;
+}
+
+// ************************************************
+// Timer Interrupt Handler
+//MIGHT NEED TO DO WORK HERE, MIGHT NEED DIFFERENT TIMER
+// ************************************************
+/*SIGNAL(TIMER1_OVF_vect)
+{
+  if (opState == OFF)
+  {
+    digitalWrite(RelayPin, LOW);  // make sure relay is off
+  }
+  else
+  {
+    //DriveOutput();
+  }
+}*/
+
+void loop() {
+  char tempSetBuf[4];
+   if (Bridge.get("setTemp", tempSetBuf, 4) > 0) {
+     setTemp = String(tempSetBuf);
+     //Console.println(setTemp);
+     //Bridge.put("targetF=", setTemp);
+   }
+
+   double c = thermocouple.readCelsius();
+   if (isnan(c)) {
+     //Console.println("Something wrong with thermocouple!");
+   } else {
+
+     //We're getting good data.  Make is so the bridge can see it
+     double tempF = thermocouple.readFarenheit();
+     if (!setTemp.equals("")) {
+       Bridge.put(TARGEF, setTemp);
+     }
+     Bridge.put(DEGF, doubleToString(tempF, 2));
+
+   }
+   delay(1000);
+
+}
+
+void Off() {
+  myPID.SetMode(MANUAL);
+  digitalWrite(RelayPin, LOW);
+}
+
+// ************************************************
+// Save any parameter changes to EEPROM
+// ************************************************
+void SaveParameters()
+{
+   if (Setpoint != EEPROM_readDouble(SpAddress))
+   {
+      EEPROM_writeDouble(SpAddress, Setpoint);
+   }
+   if (Kp != EEPROM_readDouble(KpAddress))
+   {
+      EEPROM_writeDouble(KpAddress, Kp);
+   }
+   if (Ki != EEPROM_readDouble(KiAddress))
+   {
+      EEPROM_writeDouble(KiAddress, Ki);
+   }
+   if (Kd != EEPROM_readDouble(KdAddress))
+   {
+      EEPROM_writeDouble(KdAddress, Kd);
+   }
+}
+
+// ************************************************
+// Load parameters from EEPROM
+// ************************************************
+void LoadParameters()
+{
+  // Load from EEPROM
+   Setpoint = EEPROM_readDouble(SpAddress);
+   Kp = EEPROM_readDouble(KpAddress);
+   Ki = EEPROM_readDouble(KiAddress);
+   Kd = EEPROM_readDouble(KdAddress);
+
+   // Use defaults if EEPROM values are invalid
+   if (isnan(Setpoint))
+   {
+     Setpoint = 60;
+   }
+   if (isnan(Kp))
+   {
+     Kp = 500;
+   }
+   if (isnan(Ki))
+   {
+     Ki = 0.5;
+   }
+   if (isnan(Kd))
+   {
+     Kd = 0.1;
+   }
+}
+
+
+// ************************************************
+// Write floating point values to EEPROM
+// ************************************************
+void EEPROM_writeDouble(int address, double value)
+{
+   byte* p = (byte*)(void*)&value;
+   for (int i = 0; i < sizeof(value); i++)
+   {
+      EEPROM.write(address++, *p++);
+   }
+}
+
+// ************************************************
+// Read floating point values from EEPROM
+// ************************************************
+double EEPROM_readDouble(int address)
+{
+   double value = 0.0;
+   byte* p = (byte*)(void*)&value;
+   for (int i = 0; i < sizeof(value); i++)
+   {
+      *p++ = EEPROM.read(address++);
+   }
+   return value;
+}
+
+//Helpers for String to double conversions
+String doubleToString(double input,int decimalPlaces){
+  if(decimalPlaces!=0){
+    String string = String((int)(input*pow(10,decimalPlaces)));
+    if(abs(input)<1){
+      if(input>0)
+        string = "0"+string;
+      else if(input<0)
+        string = string.substring(0,1)+"0"+string.substring(1);
+    }
+    return string.substring(0,string.length()-decimalPlaces)+"."+string.substring(string.length()-decimalPlaces);
+    } else {
+      return String((int)input);
+  }
+}
+
+double stringToDouble(String input) {
+    char floatbuf[8];
+    input.toCharArray(floatbuf, sizeof(floatbuf));
+    return atof(floatbuf);
+}


Added example with LCD and LED strip with sockets

Signed-off-by: Seb Lee-Delisle <d7df902c08988d3a66f2972356a5b54ec7fc19f6@gmail.com>

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

--- Arduino/cX_SocketsLCD_LED/cX_SocketsLCD_LED.ino
+++ Arduino/cX_SocketsLCD_LED/cX_SocketsLCD_LED.ino
@@ -0,0 +1,237 @@
+#include <Adafruit_NeoPixel.h>
+#include <HSBColor.h>
+#include <Adafruit_CC3000.h>
+#include <SPI.h>
+#include "ST4iWifiManager.h"
+#include <WebSocketClient.h>
+#include <JsonParser.h>
+using namespace ArduinoJson::Parser;
+
+#include <LiquidCrystal.h>
+LiquidCrystal lcd(19,18,17,16,15,14);
+
+ST4iWifiManager wifi;
+
+int numPixels = 12;
+int rgb[] = {0,0,0};
+Adafruit_NeoPixel strip(numPixels, 22,  NEO_GRB + NEO_KHZ800);
+
+
+
+#define SERVER      "node.seb.ly"
+#define PATH         "/"
+#define PORT         8102
+
+#define WIFI "68 Middle Street"
+#define PASSWORD "thund3rstorm"
+
+// Change this to YOUR name!
+String id = String("Seb");
+
+JsonParser<100> parser;
+
+const int ledPin = 44;
+const int buttonPin = 21;
+const int wifiLed = 2;
+const int buzzerPin = 34;
+const int heartbeatFrequency = 20000;
+
+boolean buttonPushed = false;
+
+uint32_t ip;
+unsigned long lastSend;
+
+int hue = 0;
+int targetHue = 0;
+int saturation = 100;
+
+
+WebSocketClient wsclient;
+
+void setup() {
+  Serial.begin(115200);
+
+  strip.begin();
+  strip.show();
+
+  showColour(0xff00ff);
+
+  // 16 x 2 characters
+  lcd.begin(16, 2);
+  lcd.clear();
+  lcd.print("Connecting...");
+
+  wifi.init(wifiLed, 30);
+  wifi.connect(WIFI, PASSWORD, WLAN_SEC_WPA2);
+
+  lcd.setCursor(0,1);
+  lcd.print("Wifi OK");
+
+  pinMode(ledPin, OUTPUT);
+  pinMode(buttonPin, INPUT);
+
+  digitalWrite(ledPin, HIGH);
+  delay(1000);
+  digitalWrite(ledPin, LOW);
+
+
+
+  connectWebsocket();
+  lcd.setCursor(0,1);
+  lcd.print("Socket Connected");
+
+
+
+}
+
+void loop() {
+
+  // check wifi !
+  wifi.monitor();
+  // check websocket
+  wsclient.monitor();
+
+  if(!wsclient.connected()) {
+    Serial.println("Websocket disconnected, reconnecting");
+     // try reconnecting!
+     connectWebsocket();
+  }
+
+  // heartbeat code to keep the connection alive
+  if(millis() - lastSend > heartbeatFrequency) {
+    Serial.print("*");
+    wsclient.send(String("{\"type\" : \"heartbeat\", \"id\" : \"")+id+String("\"}"));
+    lastSend = millis();
+
+  }
+
+
+  if(hue<targetHue) hue++;
+  else if(hue>targetHue) hue--;
+
+  for(int i = 0; i<numPixels; i++) {
+    int brightness = map(sin((double)(millis()+(i*100))*0.01f ) * 100, -100, 100, 0,100);
+    setPixelHSB(i, hue, saturation, brightness);
+  }
+  strip.show();
+
+
+
+}
+
+void showColour(uint32_t c) {
+
+   for(int i = 0; i<numPixels; i++) {
+
+      strip.setPixelColor(i, c);
+
+   }
+   strip.show();
+
+}
+
+
+void dataArrived(WebSocketClient wsclient, String data) {
+
+  char jsonchar[data.length()+1];
+  data.toCharArray(jsonchar, data.length()+1);
+
+  // should poss parse json?
+  JsonObject json = parser.parse(jsonchar);
+  Serial.println("Data Arrived: " + data);
+
+  const char* msgid = json["id"];
+
+  if(strcmp(msgid, id.c_str())!=0) return;
+
+  const char* type = json["type"];
+
+  Serial.println(type);
+  if(strcmp(type,"light")==0) {
+
+    Serial.println("found light");
+    int state = json["data"];
+
+    if(state==1) {
+      digitalWrite(ledPin, HIGH);
+      tone(buzzerPin,294);
+
+    }
+    else {
+      digitalWrite(ledPin, LOW);
+      noTone(buzzerPin);
+    }
+  }
+  else if(strcmp(type,"message")==0) {
+
+    Serial.println("found message");
+    char* msg = json["data"];
+    Serial.println(msg);
+    showStringOnLCD(msg);
+
+    if(strcmp(msg, "red") == 0) {
+
+       //showColour(0xff0000);
+
+       targetHue = 0;
+
+    } else if(strcmp(msg, "blue") == 0) {
+      targetHue = 210;
+       //showColour(0x00ff00);
+
+    } else if(strcmp(msg, "cyan") == 0) {
+      targetHue = 180;
+       //showColour(0x00ffff);
+
+    } else if(strcmp(msg, "orange") == 0) {
+      targetHue = 60;
+       //showColour(0xffab00);
+
+    }
+
+
+
+  }
+}
+
+
+
+void showStringOnLCD(char * msg) {
+  lcd.clear();
+  lcd.setCursor(0,0);
+  lcd.print(msg);
+
+
+}
+
+
+void connectWebsocket() {
+
+  wsclient = WebSocketClient();
+  Serial.println("connecting to socket server");
+
+  while(!wsclient.connect(&wifi.client, SERVER, PATH, PORT)) {
+    Serial.println("couldn't connect :( Trying again...");
+    delay(1000);
+  }
+  Serial.println("Connected to Websocket server!");
+
+  Serial.println("Socket connected!");
+  wsclient.setDataArrivedDelegate(dataArrived);
+  String sendstring = String(String("{\"type\" : \"register\", \"id\" : \"")+id+String("\"}"));
+  wsclient.send(sendstring);
+  lastSend = millis();
+
+}
+
+
+void setPixelHSB(int pixelnum, int hue, int saturation, int brightness) {
+
+  while(hue<0) hue+=360;
+  while(hue>360) hue-=360;
+  H2R_HSBtoRGB( hue, saturation, brightness, &rgb[0]);
+  strip.setPixelColor(pixelnum, strip.Color(rgb[0], rgb[1], rgb[2]));
+
+}
+
+


Meant to test communication with the central

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

--- firmware/2016/teste_communication/teste_communication.ino
+++ firmware/2016/teste_communication/teste_communication.ino
@@ -0,0 +1,54 @@
+#include <SPI.h>
+#include "RF24.h"
+
+RF24 radio(10,A0);    //arduino pro micro
+
+byte pipe[][6] = {"1Node","2Node","3Node","4Node"};
+int send_msg[2]; //pipe number
+
+void setup() {
+  Serial.begin(250000);
+  while(!Serial);
+  Serial.println("Inicio - robo");
+  radio.begin();
+
+  radio.setPALevel(RF24_PA_MAX);
+  radio.setDataRate(RF24_2MBPS);
+  radio.setChannel(108);
+
+  radio.openReadingPipe(1,pipe[1]);
+  radio.openWritingPipe(pipe[0]);    //n0->central pelo pipe0
+
+  radio.startListening();
+}
+
+int contador = 0;
+
+void test_send() {
+  radio.stopListening();
+
+  send_msg[0] = contador++;
+  send_msg[1] = -contador;
+  Serial.println(contador);
+  radio.write(send_msg, sizeof(send_msg));
+
+  radio.startListening();
+}
+
+int msg_from_central[2] = {0,0};
+
+void test_receive() {
+  if(radio.available()){
+    while (radio.available()) {
+      radio.read(&msg_from_central, sizeof(msg_from_central));
+    }
+    Serial.println(msg_from_central[0]);
+    Serial.println(msg_from_central[1]);
+  }
+}
+
+void loop() {
+  test_receive();
+  delay(10);
+}
+


Se crea proyecto graficos lcd nokia 5110

error: pathspec 'graficar-lcd-nokia-5110/graficar-lcd-nokia-5110.ino' did not match any file(s) known to git

--- graficar-lcd-nokia-5110/graficar-lcd-nokia-5110.ino
+++ graficar-lcd-nokia-5110/graficar-lcd-nokia-5110.ino
@@ -0,0 +1,58 @@
+#include <SPI.h>
+#include <Adafruit_GFX.h>
+#include <Adafruit_PCD8544.h>
+
+Adafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3);
+
+#define NUMFLAKES 10
+#define XPOS 0
+#define YPOS 1
+#define DELTAY 2
+
+
+#define LOGO16_GLCD_HEIGHT 16
+#define LOGO16_GLCD_WIDTH  16
+
+void setup() {
+  Serial.begin(9600);
+
+  display.begin();
+  display.setContrast(50);
+  display.display();
+  display.clearDisplay();
+}
+
+void loop() {
+  display.clearDisplay();
+  setMessage("Pixel");
+  display.drawPixel(42, 24, BLACK);
+  display.display();
+  delay(2000);
+
+  display.clearDisplay();
+  setMessage("Linea");
+  display.drawLine(0, 24, 84, 24, BLACK);
+  display.display();
+  delay(2000);
+
+  display.clearDisplay();
+  setMessage("Linea");
+  display.drawRect(0, 10, 84, 32, BLACK);
+  display.display();
+  delay(2000);
+
+  display.clearDisplay();
+  setMessage("Circulo");
+  display.drawCircle(42, 24, 18, BLACK);
+  display.display();
+  delay(2000);
+}
+
+void setMessage(String msj){
+  display.setTextSize(1);
+  display.setTextColor(BLACK);
+  display.setCursor(0,0);
+  display.println(msj);
+  display.display();
+}
+